From 6bb81a8c0d3efa5ff7f82e599e5e7ea3840ca4de Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 29 Apr 2021 03:01:41 +0300 Subject: [PATCH] Fix crash when logging without "Remember Me" checkbox --- src/bundles/main.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bundles/main.ts b/src/bundles/main.ts index 519785e61..8e49796d9 100644 --- a/src/bundles/main.ts +++ b/src/bundles/main.ts @@ -1,4 +1,4 @@ -import { getDispatch } from '../lib/teact/teactn'; +import { getDispatch, getGlobal } from '../lib/teact/teactn'; import { DEBUG } from '../config'; @@ -9,4 +9,6 @@ if (DEBUG) { console.log('>>> FINISH LOAD MAIN BUNDLE'); } -getDispatch().initApi(); +if (!getGlobal().connectionState) { + getDispatch().initApi(); +}