Revert "Sign out when session is terminated from another application"

This reverts commit 4a57034854e0c9e91bca15204f446d4fdcbe6a6a.
This commit is contained in:
Alexander Zinchuk 2021-04-15 00:28:53 +03:00
parent 2aa94c88dc
commit f774f19ee2

View File

@ -97,8 +97,6 @@ export async function destroy() {
function handleGramJsUpdate(update: any) {
if (update instanceof connection.UpdateConnectionState) {
isConnected = update.state === connection.UpdateConnectionState.connected;
} else if (update instanceof GramJs.UpdatesTooLong) {
void handleTerminatedSession();
}
}
@ -233,18 +231,3 @@ function injectUpdateEntities(result: GramJs.Updates | GramJs.UpdatesCombined) {
}
});
}
async function handleTerminatedSession() {
try {
await invokeRequest(new GramJs.users.GetFullUser({
id: new GramJs.InputUserSelf(),
}), undefined, true);
} catch (err) {
if (err.message === 'AUTH_KEY_UNREGISTERED') {
onUpdate({
'@type': 'updateConnectionState',
connectionState: 'connectionStateBroken',
});
}
}
}