From 9435381b2493b4dbd0747433e2d88758d83c4c52 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 18 Nov 2022 00:57:13 +0400 Subject: [PATCH] Fix Web Token login (again 2) (#2140) --- src/global/actions/apiUpdaters/initial.ts | 14 +++++++++++--- src/global/types.ts | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/global/actions/apiUpdaters/initial.ts b/src/global/actions/apiUpdaters/initial.ts index 296f64cbd..e0989bd9d 100644 --- a/src/global/actions/apiUpdaters/initial.ts +++ b/src/global/actions/apiUpdaters/initial.ts @@ -111,11 +111,19 @@ function onUpdateAuthorizationState(update: ApiUpdateAuthorizationState) { }); break; case 'authorizationStateWaitPassword': - setGlobal({ + global = { ...global, authHint: update.hint, - hasWebAuthTokenPasswordRequired: update.noReset, - }); + }; + + if (update.noReset) { + global = { + ...global, + hasWebAuthTokenPasswordRequired: true, + }; + } + + setGlobal(global); break; case 'authorizationStateWaitQrCode': setGlobal({ diff --git a/src/global/types.ts b/src/global/types.ts index f34d5815f..9ab41d5bf 100644 --- a/src/global/types.ts +++ b/src/global/types.ts @@ -141,7 +141,7 @@ export type GlobalState = { appConfig?: ApiAppConfig; canInstall?: boolean; hasWebAuthTokenFailed?: boolean; - hasWebAuthTokenPasswordRequired?: boolean; + hasWebAuthTokenPasswordRequired?: true; isChatInfoShown: boolean; isStatisticsShown?: boolean; isLeftColumnShown: boolean;