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

Fix filters in non-active accounts.

This commit is contained in:
John Preston
2020-06-22 11:30:32 +04:00
parent a45d088ee4
commit 1705a1aa4a
3 changed files with 14 additions and 19 deletions

View File

@@ -141,7 +141,7 @@ SessionController::SessionController(
session->data().chatsFilters().changed(
) | rpl::start_with_next([=] {
checkOpenedFilter();
crl::on_main(session, [=] {
crl::on_main(this, [=] {
refreshFiltersMenu();
});
}, session->lifetime());
@@ -216,12 +216,7 @@ void SessionController::toggleFiltersMenu(bool enabled) {
}
void SessionController::refreshFiltersMenu() {
const auto enabled = !session().data().chatsFilters().list().empty();
if (enabled != session().settings().dialogsFiltersEnabled()) {
session().settings().setDialogsFiltersEnabled(enabled);
session().saveSettingsDelayed();
toggleFiltersMenu(enabled);
}
toggleFiltersMenu(!session().data().chatsFilters().list().empty());
}
rpl::producer<> SessionController::filtersMenuChanged() const {