Multitabs: Fix broken app when multitabs are not supported (#2642)
This commit is contained in:
parent
b898b0856b
commit
7bcbae4e0d
@ -3,6 +3,7 @@ import {
|
|||||||
} from './index';
|
} from './index';
|
||||||
|
|
||||||
import { INITIAL_GLOBAL_STATE, INITIAL_TAB_STATE } from './initialState';
|
import { INITIAL_GLOBAL_STATE, INITIAL_TAB_STATE } from './initialState';
|
||||||
|
import { IS_MULTITAB_SUPPORTED } from '../util/environment';
|
||||||
import { IS_MOCKED_CLIENT } from '../config';
|
import { IS_MOCKED_CLIENT } from '../config';
|
||||||
import { initCache, loadCache } from './cache';
|
import { initCache, loadCache } from './cache';
|
||||||
import { cloneDeep } from '../util/iteratees';
|
import { cloneDeep } from '../util/iteratees';
|
||||||
@ -62,8 +63,8 @@ addActionHandler('init', (global, actions, payload): ActionReturnType => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isMasterTab) {
|
if (isMasterTab || !IS_MULTITAB_SUPPORTED) {
|
||||||
initialTabState.isMasterTab = isMasterTab;
|
initialTabState.isMasterTab = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(global.messages.byChatId).forEach((chatId) => {
|
Object.keys(global.messages.byChatId).forEach((chatId) => {
|
||||||
@ -122,6 +123,10 @@ addActionHandler('init', (global, actions, payload): ActionReturnType => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!IS_MULTITAB_SUPPORTED) {
|
||||||
|
actions.initApi();
|
||||||
|
}
|
||||||
|
|
||||||
return updateTabState(global, {
|
return updateTabState(global, {
|
||||||
messageLists: parsedMessageList ? [parsedMessageList] : initialTabState.messageLists,
|
messageLists: parsedMessageList ? [parsedMessageList] : initialTabState.messageLists,
|
||||||
}, tabId);
|
}, tabId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user