From 656cac55728da0cab0278176837b1030d3e3d676 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Mon, 28 Jun 2021 16:45:23 +0300 Subject: [PATCH] Timeout for t.me log out --- src/lib/mtproto/mtprotoworker.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/mtproto/mtprotoworker.ts b/src/lib/mtproto/mtprotoworker.ts index eb29b51a..aa700971 100644 --- a/src/lib/mtproto/mtprotoworker.ts +++ b/src/lib/mtproto/mtprotoworker.ts @@ -28,6 +28,7 @@ import AppStorage from '../storage'; import appRuntimeManager from '../appManagers/appRuntimeManager'; import { SocketProxyTask } from './transports/socketProxied'; import telegramMeWebManager from './telegramMeWebManager'; +import { pause } from '../../helpers/schedulers'; type Task = { taskId: number, @@ -103,7 +104,10 @@ export class ApiManagerProxy extends CryptoWorkerMethods { Promise.all([ AppStorage.toggleStorage(false), sessionStorage.clear(), - telegramMeWebManager.setAuthorized(false), + Promise.race([ + telegramMeWebManager.setAuthorized(false), + pause(3000) + ]), webPushApiManager.forceUnsubscribe() ]).finally(() => { appRuntimeManager.reload();