From fc0dd3955092235c5b52c4da066954b6e3beaa19 Mon Sep 17 00:00:00 2001 From: Fringg Date: Wed, 11 Feb 2026 05:50:31 +0300 Subject: [PATCH] fix: use openTelegramLink for CryptoBot payment to open invoice in Telegram --- src/pages/TopUpAmount.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/pages/TopUpAmount.tsx b/src/pages/TopUpAmount.tsx index fb18324..3032224 100644 --- a/src/pages/TopUpAmount.tsx +++ b/src/pages/TopUpAmount.tsx @@ -87,7 +87,7 @@ export default function TopUpAmount() { const queryClient = useQueryClient(); const { formatAmount, currencySymbol, convertAmount, convertToRub, targetCurrency } = useCurrency(); - const { openInvoice } = usePlatform(); + const { openInvoice, openTelegramLink, openLink } = usePlatform(); const haptic = useHaptic(); const inputRef = useRef(null); @@ -281,6 +281,15 @@ export default function TopUpAmount() { : convertAmount(rub).toFixed(currencyDecimals); const isPending = topUpMutation.isPending || starsPaymentMutation.isPending; + const handleOpenPayment = () => { + if (!paymentUrl) return; + if (paymentUrl.includes('t.me/')) { + openTelegramLink(paymentUrl); + } else { + openLink(paymentUrl); + } + }; + const handleCopyUrl = async () => { if (!paymentUrl) return; try { @@ -478,15 +487,14 @@ export default function TopUpAmount() {

{t('balance.clickToOpenPayment')}

- {t('balance.openPaymentPage')} - +