Fix loading emoji pack

This commit is contained in:
Eduard Kuzmenko 2022-06-28 00:13:33 +02:00
parent ae85630fbd
commit 18095d0406
2 changed files with 10 additions and 4 deletions

View File

@ -102,10 +102,6 @@ export default function createManagers(appStoragesManager: AppStoragesManager, u
ctx[name] = manager;
}
if(userId) {
managers.apiManager.setUserAuth(userId);
}
const promises: Array<Promise<(() => void) | void> | void>[] = [];
let names = Object.keys(managers) as (keyof T)[];
names.unshift('appUsersManager', 'appChatsManager', 'appNotificationsManager', 'appMessagesManager', 'dialogsStorage');
@ -125,5 +121,9 @@ export default function createManagers(appStoragesManager: AppStoragesManager, u
}
}
if(userId) {
managers.apiManager.setUserAuth(userId);
}
return Promise.all(promises).then(() => managers);
}

View File

@ -27,6 +27,7 @@ export function isServiceWorkerOnline() {
}
const log = logger('MTPROTO');
// let haveState = false;
const port = new MTProtoMessagePort<false>();
port.addMultipleEventsListeners({
@ -41,6 +42,10 @@ port.addMultipleEventsListeners({
},
state: ({state, resetStorages, pushedKeys, newVersion, oldVersion, userId}) => {
// if(haveState) {
// return;
// }
log('got state', state, pushedKeys);
appStateManager.userId = userId;
@ -52,6 +57,7 @@ port.addMultipleEventsListeners({
});
RESET_STORAGES_PROMISE.resolve(resetStorages);
// haveState = true;
},
toggleStorages: ({enabled, clearWrite}) => {