Fix loading single messages from private peers

This commit is contained in:
Eduard Kuzmenko 2021-07-22 14:52:31 +03:00
parent 1d3572c3d9
commit a7c5e8bc42

View File

@ -5040,15 +5040,17 @@ export class AppMessagesManager {
}); });
} }
promises.push(promise.then(getMessagesResult => { const after = promise.then(getMessagesResult => {
if(getMessagesResult._ !== 'messages.messagesNotModified') { if(getMessagesResult._ !== 'messages.messagesNotModified') {
appUsersManager.saveApiUsers(getMessagesResult.users); appUsersManager.saveApiUsers(getMessagesResult.users);
appChatsManager.saveApiChats(getMessagesResult.chats); appChatsManager.saveApiChats(getMessagesResult.chats);
this.saveMessages(getMessagesResult.messages); this.saveMessages(getMessagesResult.messages);
} }
}).finally(() => {
rootScope.dispatchEvent('messages_downloaded', {peerId: +peerId, mids}); rootScope.dispatchEvent('messages_downloaded', {peerId: +peerId, mids});
})); });
promises.push(after);
} }
Promise.all(promises).finally(() => { Promise.all(promises).finally(() => {