mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Improve phrases for loading / empty filters.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user