Fix logging out getting the app stuck on a 'loading' screen

This commit is contained in:
Robin Townsend
2023-08-09 12:00:13 -04:00
parent ec5b245610
commit b96b3dd5ef

View File

@@ -218,7 +218,7 @@ export const ClientProvider: FC<Props> = ({ children }) => {
}); });
} else { } else {
clearSession(); clearSession();
setInitClientState(undefined); setInitClientState(null);
} }
}, },
[initClientState?.client] [initClientState?.client]
@@ -233,7 +233,7 @@ export const ClientProvider: FC<Props> = ({ children }) => {
await client.logout(true); await client.logout(true);
await client.clearStores(); await client.clearStores();
clearSession(); clearSession();
setInitClientState(undefined); setInitClientState(null);
history.push("/"); history.push("/");
PosthogAnalytics.instance.setRegistrationType(RegistrationType.Guest); PosthogAnalytics.instance.setRegistrationType(RegistrationType.Guest);
}, [history, initClientState?.client]); }, [history, initClientState?.client]);