fix: hideAllChats

Co-authored-by: c0re100 <corehusky@gmail.com>
This commit is contained in:
AlexeyZavar 2024-04-17 03:05:05 +03:00
parent 77d20c11a7
commit c55cab3b1a
2 changed files with 4 additions and 2 deletions

View file

@ -780,7 +780,9 @@ FilterId ChatFilters::lookupId(int index) const {
return FilterId(); // AyuGram: fix crash when using `hideAllChatsFolder`
}
if (_owner->session().user()->isPremium() || !_list.front().id()) {
const auto settings = &AyuSettings::getInstance();
if (_owner->session().user()->isPremium() || !_list.front().id() || settings->hideAllChatsFolder) {
return _list[index].id();
}
const auto i = ranges::find(_list, FilterId(0), &ChatFilter::id);

View file

@ -260,7 +260,7 @@ void FiltersMenu::refresh() {
// and there will be an exception in `Window::SessionController::showPeerHistory`
// because `SessionController::content()` == nullptr
if (settings->hideAllChatsFolder && _session->widget()->sessionContent()) {
const auto lookupId = filters->lookupId(premium() ? 0 : 1);
const auto lookupId = filters->lookupId(0);
_session->setActiveChatsFilter(lookupId);
}
}