Multitabs: Fix sync (#2600)
This commit is contained in:
parent
39feed7b8d
commit
f080ef3051
@ -236,7 +236,10 @@ addCallback((global: GlobalState) => {
|
|||||||
const { connectionState, authState } = global;
|
const { connectionState, authState } = global;
|
||||||
const { isMasterTab } = selectTabState(global);
|
const { isMasterTab } = selectTabState(global);
|
||||||
if (!isMasterTab || (previousGlobal?.connectionState === connectionState
|
if (!isMasterTab || (previousGlobal?.connectionState === connectionState
|
||||||
&& previousGlobal?.authState === authState)) return;
|
&& previousGlobal?.authState === authState)) {
|
||||||
|
previousGlobal = global;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (connectionState === 'connectionStateReady' && authState === 'authorizationStateReady') {
|
if (connectionState === 'connectionStateReady' && authState === 'authorizationStateReady') {
|
||||||
// eslint-disable-next-line eslint-multitab-tt/no-getactions-in-actions
|
// eslint-disable-next-line eslint-multitab-tt/no-getactions-in-actions
|
||||||
|
|||||||
@ -51,6 +51,13 @@ addActionHandler('switchMultitabRole', async (global, actions, payload): Promise
|
|||||||
|
|
||||||
global = getGlobal();
|
global = getGlobal();
|
||||||
if (!global.passcode.hasPasscode || !global.passcode.isScreenLocked) {
|
if (!global.passcode.hasPasscode || !global.passcode.isScreenLocked) {
|
||||||
|
if (global.connectionState === 'connectionStateReady') {
|
||||||
|
global = {
|
||||||
|
...global,
|
||||||
|
connectionState: 'connectionStateConnecting',
|
||||||
|
};
|
||||||
|
setGlobal(global);
|
||||||
|
}
|
||||||
actions.initApi();
|
actions.initApi();
|
||||||
|
|
||||||
const { hasWebNotifications, hasPushNotifications } = selectNotifySettings(global);
|
const { hasWebNotifications, hasPushNotifications } = selectNotifySettings(global);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user