mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-13 22:18:51 +01:00
🔒 fix: Robust Cache Reset on User Logout (#1324)
* refactor(Logout): rely on hooks for mutation behavior * fix: logging out now correctly resets cache, disallowing any cache mixing between the next logged in user on the same browser * chore: remove additional localStorage values on logout
This commit is contained in:
parent
583e978a82
commit
968b8ccdbd
10 changed files with 109 additions and 90 deletions
|
|
@ -1,5 +1,16 @@
|
|||
import { UseQueryOptions, useQuery, QueryObserverResult } from '@tanstack/react-query';
|
||||
import { QueryKeys, dataService } from 'librechat-data-provider';
|
||||
import type { TPreset } from 'librechat-data-provider';
|
||||
export const useGetPresetsQuery = (
|
||||
config?: UseQueryOptions<TPreset[]>,
|
||||
): QueryObserverResult<TPreset[], unknown> => {
|
||||
return useQuery<TPreset[]>([QueryKeys.presets], () => dataService.getPresets(), {
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnMount: false,
|
||||
...config,
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetEndpointsConfigOverride = <TData = unknown | boolean>(
|
||||
config?: UseQueryOptions<unknown | boolean, unknown, TData>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue