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

Optimized height refresh of chats list for chat filters with rules.

This commit is contained in:
23rd
2024-11-20 07:51:03 +03:00
parent 889fcb3939
commit e314c68a56
2 changed files with 23 additions and 0 deletions

View File

@@ -2260,6 +2260,27 @@ void InnerWidget::handleChatListEntryRefreshes() {
std::abs(from - to) + event.moved.height);
}
}, lifetime());
session().data().chatListEntryRefreshes(
) | rpl::filter([=](const Event &event) {
if (_waitingAllChatListEntryRefreshesForTags) {
return false;
}
if (event.existenceChanged) {
if (event.key.entry()->inChatList(_filterId)) {
_waitingAllChatListEntryRefreshesForTags = true;
return true;
}
}
return false;
}) | rpl::start_with_next([=](const Event &event) {
Ui::PostponeCall(crl::guard(this, [=] {
_waitingAllChatListEntryRefreshesForTags = false;
if (_shownList->updateHeights(_narrowRatio)) {
refresh();
}
}));
}, lifetime());
}
void InnerWidget::repaintCollapsedFolderRow(not_null<Data::Folder*> folder) {