From a4fb95a34a3e209bee32757d601fec26b0cfdcb7 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 15 Aug 2025 18:25:25 +0200 Subject: [PATCH] Gift Info Modal: Fix `canBuyGift` (#6105) --- src/components/modals/gift/info/GiftInfoModal.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/modals/gift/info/GiftInfoModal.tsx b/src/components/modals/gift/info/GiftInfoModal.tsx index 02eeadd63..93ae28df3 100644 --- a/src/components/modals/gift/info/GiftInfoModal.tsx +++ b/src/components/modals/gift/info/GiftInfoModal.tsx @@ -164,7 +164,7 @@ const GiftInfoModal = ({ const resellPrice = getResalePrice(); const confirmPrice = getResalePrice(shouldPayInTon); - const canBuyGift = !canManage && Boolean(resellPrice); + const canBuyGift = gift?.type === 'starGiftUnique' && gift.ownerId !== currentUserId && Boolean(resellPrice); const giftOwnerTitle = (() => { if (!isGiftUnique) return undefined; @@ -423,14 +423,14 @@ const GiftInfoModal = ({
- {Boolean(canManage && resellPrice) && ( + {canBuyGift && (
- {resellPrice!.currency === TON_CURRENCY_CODE - ? formatTonAsIcon(lang, resellPrice!.amount, { + {resellPrice.currency === TON_CURRENCY_CODE + ? formatTonAsIcon(lang, resellPrice.amount, { className: styles.giftResalePriceStar, shouldConvertFromNanos: true, }) - : formatStarsAsIcon(lang, resellPrice!.amount, { + : formatStarsAsIcon(lang, resellPrice.amount, { asFont: true, className: styles.giftResalePriceStar, })}