diff --git a/src/api/gramjs/methods/client.ts b/src/api/gramjs/methods/client.ts index dbfdc32d8..0d3553789 100644 --- a/src/api/gramjs/methods/client.ts +++ b/src/api/gramjs/methods/client.ts @@ -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', - }); - } - } -}