mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-25 15:03:03 +02:00
Fix dropping filter in gifts.
This commit is contained in:
parent
79f0b22276
commit
9cb89fff45
2 changed files with 12 additions and 6 deletions
|
@ -368,7 +368,9 @@ void InnerWidget::loadMore() {
|
|||
} else {
|
||||
_allLoaded = true;
|
||||
}
|
||||
_totalCount = data.vcount().v;
|
||||
if (!filter.skipsSomething()) {
|
||||
_totalCount = data.vcount().v;
|
||||
}
|
||||
|
||||
const auto owner = &_peer->owner();
|
||||
owner->processUsers(data.vusers());
|
||||
|
@ -583,11 +585,7 @@ void InnerWidget::refreshAbout() {
|
|||
const auto filter = _filter.current();
|
||||
const auto filteredEmpty = _allLoaded
|
||||
&& _entries.empty()
|
||||
&& (filter.skipLimited
|
||||
|| filter.skipUnlimited
|
||||
|| filter.skipSaved
|
||||
|| filter.skipUnsaved
|
||||
|| filter.skipUnique);
|
||||
&& filter.skipsSomething();
|
||||
|
||||
if (filteredEmpty) {
|
||||
auto text = tr::lng_peer_gifts_empty_search(
|
||||
|
|
|
@ -34,6 +34,14 @@ struct Filter {
|
|||
bool skipSaved : 1 = false;
|
||||
bool skipUnsaved : 1 = false;
|
||||
|
||||
[[nodiscard]] bool skipsSomething() const {
|
||||
return skipLimited
|
||||
|| skipUnlimited
|
||||
|| skipSaved
|
||||
|| skipUnsaved
|
||||
|| skipUnique;
|
||||
}
|
||||
|
||||
friend inline bool operator==(Filter, Filter) = default;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue