mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Don't show resale gifts as "sold out".
This commit is contained in:
parent
53e8df3542
commit
efb566bcc7
1 changed files with 20 additions and 0 deletions
|
@ -2940,7 +2940,27 @@ void AddBlock(
|
|||
});
|
||||
}
|
||||
} else {
|
||||
// First, gather information about which gifts are available on resale
|
||||
base::flat_set<uint64> resaleGiftIds;
|
||||
if (price != kPriceTabResale) {
|
||||
// Only need this info when not viewing the resale tab
|
||||
for (const auto &gift : gifts) {
|
||||
if (gift.resale) {
|
||||
resaleGiftIds.insert(gift.info.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto pred = [&](const GiftTypeStars &gift) {
|
||||
// Skip sold out gifts if they're available on resale
|
||||
// (unless we're specifically viewing resale gifts)
|
||||
if (price != kPriceTabResale &&
|
||||
IsSoldOut(gift.info) &&
|
||||
!gift.resale &&
|
||||
resaleGiftIds.contains(gift.info.id)) {
|
||||
return true; // Remove this gift
|
||||
}
|
||||
|
||||
return (price == kPriceTabLimited)
|
||||
? (!gift.info.limitedCount)
|
||||
: (price == kPriceTabResale)
|
||||
|
|
Loading…
Add table
Reference in a new issue