Gift Info Modal: Fix canBuyGift (#6105)

This commit is contained in:
Alexander Zinchuk 2025-08-15 18:25:25 +02:00
parent 762919a108
commit a4fb95a34a

View File

@ -164,7 +164,7 @@ const GiftInfoModal = ({
const resellPrice = getResalePrice(); const resellPrice = getResalePrice();
const confirmPrice = getResalePrice(shouldPayInTon); const confirmPrice = getResalePrice(shouldPayInTon);
const canBuyGift = !canManage && Boolean(resellPrice); const canBuyGift = gift?.type === 'starGiftUnique' && gift.ownerId !== currentUserId && Boolean(resellPrice);
const giftOwnerTitle = (() => { const giftOwnerTitle = (() => {
if (!isGiftUnique) return undefined; if (!isGiftUnique) return undefined;
@ -423,14 +423,14 @@ const GiftInfoModal = ({
<div <div
className={styles.modalHeader} className={styles.modalHeader}
> >
{Boolean(canManage && resellPrice) && ( {canBuyGift && (
<div className={styles.giftResalePriceContainer}> <div className={styles.giftResalePriceContainer}>
{resellPrice!.currency === TON_CURRENCY_CODE {resellPrice.currency === TON_CURRENCY_CODE
? formatTonAsIcon(lang, resellPrice!.amount, { ? formatTonAsIcon(lang, resellPrice.amount, {
className: styles.giftResalePriceStar, className: styles.giftResalePriceStar,
shouldConvertFromNanos: true, shouldConvertFromNanos: true,
}) })
: formatStarsAsIcon(lang, resellPrice!.amount, { : formatStarsAsIcon(lang, resellPrice.amount, {
asFont: true, asFont: true,
className: styles.giftResalePriceStar, className: styles.giftResalePriceStar,
})} })}