2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Improve phrases for loading / empty filters.

This commit is contained in:
John Preston
2020-03-18 18:10:22 +04:00
parent f0322cd107
commit ad8b0387f3
4 changed files with 32 additions and 16 deletions

View File

@@ -141,6 +141,7 @@ SessionController::SessionController(
session->data().chatsFilters().changed(
) | rpl::start_with_next([=] {
checkOpenedFilter();
crl::on_main(session, [=] {
refreshFiltersMenu();
});
@@ -226,6 +227,16 @@ rpl::producer<> SessionController::filtersMenuChanged() const {
return _filtersMenuChanged.events();
}
void SessionController::checkOpenedFilter() {
if (const auto filterId = activeChatsFilterCurrent()) {
const auto &list = session().data().chatsFilters().list();
const auto i = ranges::find(list, filterId, &Data::ChatFilter::id);
if (i == end(list)) {
setActiveChatsFilter(0);
}
}
}
bool SessionController::uniqueChatsInSearchResults() const {
return session().supportMode()
&& !session().settings().supportAllSearchResults()