mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
fix: hideAllChats
Co-authored-by: c0re100 <corehusky@gmail.com>
This commit is contained in:
parent
77d20c11a7
commit
c55cab3b1a
2 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue