Browse Source

Fix render ancient dialog

Fix saving contacts list to state
master
morethanwords 4 years ago
parent
commit
72951925b8
  1. 10
      src/lib/appManagers/appDialogsManager.ts
  2. 2
      src/lib/appManagers/appUsersManager.ts

10
src/lib/appManagers/appDialogsManager.ts

@ -518,12 +518,18 @@ export class AppDialogsManager { @@ -518,12 +518,18 @@ export class AppDialogsManager {
});
}
if(!result.dialogs.length || this.chatList.childElementCount == result.count) { // loaded all
// * loaded all
//if(!result.dialogs.length || this.chatList.childElementCount == result.count) {
// !result.dialogs.length не подходит, так как при супердревном диалоге getConversations его не выдаст.
if(this.chatList.childElementCount == result.count) {
this.loadedAll = true;
}
this.log.debug('getDialogs ' + loadCount + ' dialogs by offset:', offsetIndex, result, this.chatList.childElementCount);
this.scroll.onScroll();
setTimeout(() => {
this.scroll.onScroll();
}, 0);
} catch(err) {
this.log.error(err);
}

2
src/lib/appManagers/appUsersManager.ts

@ -100,6 +100,8 @@ export class AppUsersManager { @@ -100,6 +100,8 @@ export class AppUsersManager {
for(const userID of contactsList) {
appStateManager.setPeer(userID, this.getUser(userID));
}
appStateManager.pushToState('contactsList', contactsList);
});
appStateManager.getState().then((state) => {

Loading…
Cancel
Save