mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +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,11 +1,13 @@
|
|||
import { useRecoilValue } from 'recoil';
|
||||
import { useMemo, useCallback } from 'react';
|
||||
import { useUpdateUserKeysMutation, useUserKeyQuery } from 'librechat-data-provider';
|
||||
import store from '~/store';
|
||||
import {
|
||||
useUpdateUserKeysMutation,
|
||||
useUserKeyQuery,
|
||||
useGetEndpointsQuery,
|
||||
} from 'librechat-data-provider';
|
||||
|
||||
const useUserKey = (endpoint: string) => {
|
||||
const endpointsConfig = useRecoilValue(store.endpointsConfig);
|
||||
const config = endpointsConfig[endpoint];
|
||||
const { data: endpointsConfig } = useGetEndpointsQuery();
|
||||
const config = endpointsConfig?.[endpoint];
|
||||
|
||||
const { azure } = config ?? {};
|
||||
let keyEndpoint = endpoint;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue