mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-26 15:33:02 +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 {
|
} else {
|
||||||
_allLoaded = true;
|
_allLoaded = true;
|
||||||
}
|
}
|
||||||
_totalCount = data.vcount().v;
|
if (!filter.skipsSomething()) {
|
||||||
|
_totalCount = data.vcount().v;
|
||||||
|
}
|
||||||
|
|
||||||
const auto owner = &_peer->owner();
|
const auto owner = &_peer->owner();
|
||||||
owner->processUsers(data.vusers());
|
owner->processUsers(data.vusers());
|
||||||
|
@ -583,11 +585,7 @@ void InnerWidget::refreshAbout() {
|
||||||
const auto filter = _filter.current();
|
const auto filter = _filter.current();
|
||||||
const auto filteredEmpty = _allLoaded
|
const auto filteredEmpty = _allLoaded
|
||||||
&& _entries.empty()
|
&& _entries.empty()
|
||||||
&& (filter.skipLimited
|
&& filter.skipsSomething();
|
||||||
|| filter.skipUnlimited
|
|
||||||
|| filter.skipSaved
|
|
||||||
|| filter.skipUnsaved
|
|
||||||
|| filter.skipUnique);
|
|
||||||
|
|
||||||
if (filteredEmpty) {
|
if (filteredEmpty) {
|
||||||
auto text = tr::lng_peer_gifts_empty_search(
|
auto text = tr::lng_peer_gifts_empty_search(
|
||||||
|
|
|
@ -34,6 +34,14 @@ struct Filter {
|
||||||
bool skipSaved : 1 = false;
|
bool skipSaved : 1 = false;
|
||||||
bool skipUnsaved : 1 = false;
|
bool skipUnsaved : 1 = false;
|
||||||
|
|
||||||
|
[[nodiscard]] bool skipsSomething() const {
|
||||||
|
return skipLimited
|
||||||
|
|| skipUnlimited
|
||||||
|
|| skipSaved
|
||||||
|
|| skipUnsaved
|
||||||
|
|| skipUnique;
|
||||||
|
}
|
||||||
|
|
||||||
friend inline bool operator==(Filter, Filter) = default;
|
friend inline bool operator==(Filter, Filter) = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue