Refactor: replace endpointsConfig recoil store with react query (#1085)

This commit is contained in:
Danny Avila 2023-10-21 13:50:29 -04:00 committed by GitHub
parent 7d6a1d260f
commit 4073b7d05d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 83 additions and 49 deletions

View file

@ -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) => {