add warning for when syncSession is locked but called again

This commit is contained in:
41666 2021-03-14 18:22:37 -04:00
parent da9f0b6202
commit 3dda14e413

View file

@ -121,6 +121,7 @@ export const SessionContextProvider = (props: { children: React.ReactNode }) =>
// Sync session data on HalfAuth
React.useEffect(() => {
if (lock) {
console.warn('hit syncSession lock');
return;
}
@ -156,6 +157,7 @@ export const SessionContextProvider = (props: { children: React.ReactNode }) =>
saveSessionData({ sessionID: sessionID || '', session: newSession });
setSession(newSession);
setSessionState(SessionState.FullAuth);
setLock(false);
} catch (e) {
console.error('syncSession failed', e);