mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-08 18:44:22 +01:00
💽 refactor(client): Optimize ModelsConfig Query Cache (#2330)
* refactor(client): remove double caching of models via recoil to rely exclusively on react-query * chore(useConversation): add modelsQuery.data dep to callback
This commit is contained in:
parent
fb80af05be
commit
f6a84887e1
11 changed files with 76 additions and 94 deletions
|
|
@ -14,7 +14,6 @@ type TempOverrideType = Record<string, unknown> & {
|
|||
};
|
||||
|
||||
export default function useConfigOverride() {
|
||||
const setModelsConfig = useSetRecoilState(store.modelsConfig);
|
||||
const setEndpointsQueryEnabled = useSetRecoilState(store.endpointsQueryEnabled);
|
||||
const overrideQuery = useGetEndpointsConfigOverride({
|
||||
staleTime: Infinity,
|
||||
|
|
@ -33,10 +32,9 @@ export default function useConfigOverride() {
|
|||
if (modelsConfig) {
|
||||
await queryClient.cancelQueries([QueryKeys.models]);
|
||||
queryClient.setQueryData([QueryKeys.models], modelsConfig);
|
||||
setModelsConfig(modelsConfig);
|
||||
}
|
||||
},
|
||||
[queryClient, setEndpointsQueryEnabled, setModelsConfig],
|
||||
[queryClient, setEndpointsQueryEnabled],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue