mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Add separate "Change Price" context menu button.
This commit is contained in:
parent
04a7f14c0e
commit
8b5a00ca27
2 changed files with 10 additions and 7 deletions
|
@ -3583,6 +3583,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_gift_transfer_wear" = "Wear";
|
||||
"lng_gift_transfer_take_off" = "Take Off";
|
||||
"lng_gift_transfer_sell" = "Sell";
|
||||
"lng_gift_transfer_update" = "Change Price";
|
||||
"lng_gift_transfer_unlist" = "Unlist";
|
||||
"lng_gift_sell_unlist_title" = "Unlist {name}";
|
||||
"lng_gift_sell_unlist_sure" = "Are you sure you want to unlist your gift?";
|
||||
|
|
|
@ -1060,6 +1060,15 @@ void FillUniqueGiftMenu(
|
|||
}
|
||||
if (CanResellGift(&show->session(), e)) {
|
||||
const auto resalePrice = unique->starsForResale;
|
||||
const auto editPrice = (resalePrice > 0
|
||||
? tr::lng_gift_transfer_update
|
||||
: tr::lng_gift_transfer_sell)(tr::now);
|
||||
menu->addAction(editPrice, [=] {
|
||||
const auto style = st.giftWearBox
|
||||
? *st.giftWearBox
|
||||
: GiftWearBoxStyleOverride();
|
||||
ShowUniqueGiftSellBox(show, unique, savedId, style);
|
||||
}, st.resell ? st.resell : &st::menuIconTagSell);
|
||||
if (resalePrice > 0) {
|
||||
menu->addAction(tr::lng_gift_transfer_unlist(tr::now), [=] {
|
||||
const auto name = UniqueGiftName(*unique);
|
||||
|
@ -1076,13 +1085,6 @@ void FillUniqueGiftMenu(
|
|||
rpl::single(name)),
|
||||
}));
|
||||
}, st.unlist ? st.unlist : &st::menuIconTagRemove);
|
||||
} else {
|
||||
menu->addAction(tr::lng_gift_transfer_sell(tr::now), [=] {
|
||||
const auto style = st.giftWearBox
|
||||
? *st.giftWearBox
|
||||
: GiftWearBoxStyleOverride();
|
||||
ShowUniqueGiftSellBox(show, unique, savedId, style);
|
||||
}, st.resell ? st.resell : &st::menuIconTagSell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue