Clear cache from React Query on change account
This commit is contained in:
parent
8d0ebdee17
commit
4c9006609c
|
@ -255,6 +255,10 @@ export const logOut = () =>
|
|||
export const switchAccount = (accountId: string, background = false) =>
|
||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
||||
const account = getState().accounts.get(accountId);
|
||||
// Clear all stored cache from React Query
|
||||
queryClient.invalidateQueries();
|
||||
queryClient.clear();
|
||||
|
||||
return dispatch({ type: SWITCH_ACCOUNT, account, background });
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue