Fix global state saving to local storage on login (#3168)

This commit is contained in:
Alexander Zinchuk 2023-05-15 10:55:44 +02:00
parent 1ada3f8c30
commit 379c5121aa

View File

@ -14,7 +14,7 @@ import { startWebsync, stopWebsync } from '../../../util/websync';
import { subscribe, unsubscribe } from '../../../util/notifications';
import { clearCaching, setupCaching } from '../../cache';
import { decryptSessionByCurrentHash } from '../../../util/passcode';
import { storeSession } from '../../../util/sessions';
import { hasStoredSession, storeSession } from '../../../util/sessions';
import { callApi } from '../../../api/gramjs';
import type { ActionReturnType, GlobalState } from '../../types';
import { updateTabState } from '../../reducers/tabs';
@ -51,7 +51,9 @@ addActionHandler('switchMultitabRole', async (global, actions, payload): Promise
storeSession(session, session.userId);
}
setupCaching();
if (hasStoredSession(true)) {
setupCaching();
}
global = getGlobal();
if (!global.passcode.hasPasscode || !global.passcode.isScreenLocked) {