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

View File

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