Auth: Fix auth screen stuck when logged out from other device (#2697)
This commit is contained in:
parent
771eb6ff4e
commit
9213919c55
@ -209,16 +209,7 @@ function onUpdateConnectionState<T extends GlobalState>(
|
|||||||
setGlobal(global);
|
setGlobal(global);
|
||||||
|
|
||||||
if (connectionState === 'connectionStateBroken') {
|
if (connectionState === 'connectionStateBroken') {
|
||||||
// When mounting Auth `initApi` will be called from an effect. Otherwise, we force it here.
|
actions.signOut({ forceInitApi: true });
|
||||||
const isOnAuth = !global.authState || [
|
|
||||||
'authorizationStateWaitPhoneNumber',
|
|
||||||
'authorizationStateWaitCode',
|
|
||||||
'authorizationStateWaitPassword',
|
|
||||||
'authorizationStateWaitRegistration',
|
|
||||||
'authorizationStateWaitQrCode',
|
|
||||||
].includes(global.authState);
|
|
||||||
|
|
||||||
actions.signOut({ forceInitApi: isOnAuth });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user