mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-20 01:06:11 +01:00
Refactor: replace endpointsConfig recoil store with react query (#1085)
This commit is contained in:
parent
7d6a1d260f
commit
4073b7d05d
15 changed files with 83 additions and 49 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { useRecoilValue } from 'recoil';
|
||||
import { useGetEndpointsQuery } from 'librechat-data-provider';
|
||||
import type { TConversation, TPreset } from 'librechat-data-provider';
|
||||
import { getDefaultEndpoint, buildDefaultConvo } from '~/utils';
|
||||
import store from '~/store';
|
||||
|
|
@ -6,7 +7,7 @@ import store from '~/store';
|
|||
type TDefaultConvo = { conversation: Partial<TConversation>; preset?: Partial<TPreset> | null };
|
||||
|
||||
const useDefaultConvo = () => {
|
||||
const endpointsConfig = useRecoilValue(store.endpointsConfig);
|
||||
const { data: endpointsConfig = {} } = useGetEndpointsQuery();
|
||||
const modelsConfig = useRecoilValue(store.modelsConfig);
|
||||
|
||||
const getDefaultConversation = ({ conversation, preset }: TDefaultConvo) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue