2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Refresh filter chats count in filter settings.

This commit is contained in:
John Preston
2020-03-25 17:28:59 +04:00
parent fe73251d8e
commit fdabdc3626
3 changed files with 60 additions and 6 deletions

View File

@@ -67,7 +67,7 @@ Folder::Folder(not_null<Data::Session*> owner, FolderId id)
for (const auto history : _lastHistories) {
if (history->peer == update.peer) {
++_chatListViewVersion;
updateChatListEntry();
updateChatListEntryPostponed();
return;
}
}
@@ -81,15 +81,26 @@ Folder::Folder(not_null<Data::Session*> owner, FolderId id)
}) | rpl::start_with_next([=](const Dialogs::UnreadState &old) {
++_chatListViewVersion;
notifyUnreadStateChange(old);
updateChatListEntry();
updateChatListEntryPostponed();
}, _lifetime);
_chatsList.fullSize().changes(
) | rpl::start_with_next([=] {
updateChatListEntry();
updateChatListEntryPostponed();
}, _lifetime);
}
void Folder::updateChatListEntryPostponed() {
if (_updateChatListEntryPostponed) {
return;
}
_updateChatListEntryPostponed = true;
Ui::PostponeCall(this, [=] {
updateChatListEntry();
_updateChatListEntryPostponed = false;
});
}
FolderId Folder::id() const {
return _id;
}