kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Clear cache from React Query on change account
rodzic
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 });
|
||||
};
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue