mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-23 03:40:14 +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,6 +1,6 @@
|
|||
import { v4 } from 'uuid';
|
||||
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';
|
||||
import { parseConvo, getResponseSender } from 'librechat-data-provider';
|
||||
import { parseConvo, getResponseSender, useGetEndpointsQuery } from 'librechat-data-provider';
|
||||
import type { TMessage, TSubmission, TEndpointOption } from 'librechat-data-provider';
|
||||
import type { TAskFunction } from '~/common';
|
||||
import useUserKey from './useUserKey';
|
||||
|
|
@ -14,7 +14,7 @@ const useMessageHandler = () => {
|
|||
const currentConversation = useRecoilValue(store.conversation) || { endpoint: null };
|
||||
const setSubmission = useSetRecoilState(store.submission);
|
||||
const isSubmitting = useRecoilValue(store.isSubmitting);
|
||||
const endpointsConfig = useRecoilValue(store.endpointsConfig);
|
||||
const { data: endpointsConfig } = useGetEndpointsQuery();
|
||||
const [messages, setMessages] = useRecoilState(store.messages);
|
||||
const { endpoint } = currentConversation;
|
||||
const { getExpiry } = useUserKey(endpoint ?? '');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue