From 8edcedb300fab960a108fcb602f859d670154041 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Tue, 16 Jun 2026 22:59:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Telegram=20=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E6=8C=89=E9=92=AE=E5=BC=80=E7=A9=BA=E7=99=BD=E9=A1=B5?= =?UTF-8?q?=EF=BC=9A=E5=8E=BB=E6=8E=89=20about:blank=20=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/account/useBilling.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/components/account/useBilling.ts b/frontend/components/account/useBilling.ts index c573ffd6..455235e7 100644 --- a/frontend/components/account/useBilling.ts +++ b/frontend/components/account/useBilling.ts @@ -330,19 +330,20 @@ export function useBilling(params: UseBillingParams) { setPaymentError(""); setTelegramBindUrl(""); setTelegramBindCommand(""); - const popup = window.open("about:blank", "_blank", "noopener,noreferrer"); try { - const { botUrl } = await requestTelegramBotBindPayload(); + const { botUrl, botCommand } = await requestTelegramBotBindPayload(); if (!botUrl) throw new Error(copy.telegramBindLinkMissing); - if (popup && !popup.closed) { - popup.location.href = botUrl; + // Open directly — skip about:blank to avoid browser popup blockers + const win = window.open(botUrl, "_blank", "noopener,noreferrer"); + if (win) { setPaymentInfo(copy.telegramBindClickHint); } else { + // Popup blocked — show fallback link setPaymentInfo(copy.telegramPopupBlocked); setTelegramBindUrl(botUrl); + setTelegramBindCommand(botCommand); } } catch (error) { - if (popup && !popup.closed) popup.close(); setPaymentError(normalizePaymentError(error).message); } finally { setTelegramBindOpening(false);