diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 47ed14dfc..2fb445fa1 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -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 folder) { diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h index dc316c2c1..7af57126e 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.h @@ -557,6 +557,8 @@ private: base::flat_map _chatsFilterScrollStates; std::unordered_map _chatsFilterTags; + bool _waitingAllChatListEntryRefreshesForTags = false; + Fn _loadMoreCallback; Fn _loadMoreFilteredCallback; rpl::event_stream<> _listBottomReached;