Folder Manager: Init before chat load (#4431)

This commit is contained in:
Alexander Zinchuk 2024-03-29 20:51:22 +01:00
parent e21249cf0f
commit 0e77008108
2 changed files with 6 additions and 2 deletions

View File

@ -68,6 +68,8 @@ addActionHandler('sync', (global, actions): ActionReturnType => {
loadAllChats, preloadTopChatMessages, loadAllStories, loadAllHiddenStories,
} = actions;
initFolderManager();
loadAllChats({
listType: 'active',
shouldReplace: true,
@ -88,7 +90,6 @@ addActionHandler('sync', (global, actions): ActionReturnType => {
console.log('>>> FINISH SYNC');
}
initFolderManager();
loadAllChats({ listType: 'archived', shouldReplace: true });
loadAllChats({ listType: 'saved', shouldReplace: true });
preloadTopChatMessages();

View File

@ -96,6 +96,10 @@ export function setGlobal(newGlobal?: GlobalState, options?: ActionOptions) {
currentGlobal = newGlobal;
if (DEBUG) {
DEBUG_currentCapturedId = Math.random();
}
if (options?.forceSyncOnIOs) {
forceOnHeavyAnimation = true;
runCallbacks();
@ -111,7 +115,6 @@ export function setGlobal(newGlobal?: GlobalState, options?: ActionOptions) {
export function getGlobal() {
if (DEBUG) {
DEBUG_currentCapturedId = Math.random();
currentGlobal = {
...currentGlobal,
DEBUG_capturedId: DEBUG_currentCapturedId,