diff --git a/src/lib/appManagers/appChatsManager.ts b/src/lib/appManagers/appChatsManager.ts index b4d902fe..e2bed66b 100644 --- a/src/lib/appManagers/appChatsManager.ts +++ b/src/lib/appManagers/appChatsManager.ts @@ -34,7 +34,6 @@ export class AppChatsManager { //private megagroups: {[id: number]: true}; constructor() { - this.chats = this.storage.getCache(); this.clear(true); rootScope.addMultipleEventsListeners({ @@ -105,8 +104,11 @@ export class AppChatsManager { chats.findAndSplice((chat) => chat.id === chatId); this.storage.delete(chatId); + delete this.chats[chatId]; } } + } else { + this.chats = {}; } } diff --git a/src/lib/appManagers/appUsersManager.ts b/src/lib/appManagers/appUsersManager.ts index 46e12d4f..fc84506f 100644 --- a/src/lib/appManagers/appUsersManager.ts +++ b/src/lib/appManagers/appUsersManager.ts @@ -46,7 +46,6 @@ export class AppUsersManager { private getTopPeersPromise: Promise; constructor() { - this.users = this.storage.getCache(); this.clear(true); setInterval(this.updateUsersStatuses, 60000); @@ -174,9 +173,11 @@ export class AppUsersManager { users.findAndSplice((user) => user.id === userId); this.storage.delete(userId); + delete this.users[userId]; } } } else { + this.users = {}; this.usernames = {}; }