From 8c336d16c72fef8ee062e01b9c2cf32a15c8c6f7 Mon Sep 17 00:00:00 2001 From: Fringg Date: Sat, 16 May 2026 05:25:41 +0300 Subject: [PATCH] fix(blocking): open bot deep-link via platform adapter, not window.open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inside the Telegram WebView, window.open is intercepted by the client and the new-tab fallback is blocked on most platforms (Android, iOS). Use usePlatform().openTelegramLink(url) — same pattern as the rest of the codebase (Support.tsx, etc.). The TelegramAdapter dispatches to the WebApp SDK's openTelegramLink in TG and falls back to window.open in the standalone web build, so both runtimes work. --- src/components/blocking/AccountDeletedScreen.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/blocking/AccountDeletedScreen.tsx b/src/components/blocking/AccountDeletedScreen.tsx index 8cd04a4..fc453c8 100644 --- a/src/components/blocking/AccountDeletedScreen.tsx +++ b/src/components/blocking/AccountDeletedScreen.tsx @@ -1,4 +1,5 @@ import { useTranslation } from 'react-i18next'; +import { usePlatform } from '@/platform'; import { useBlockingStore } from '../../store/blocking'; /** @@ -18,12 +19,18 @@ import { useBlockingStore } from '../../store/blocking'; */ export default function AccountDeletedScreen() { const { t } = useTranslation(); + const { openTelegramLink } = usePlatform(); const info = useBlockingStore((state) => state.accountDeletedInfo); const deepLink = info?.telegram_deep_link?.trim() || null; + // Route through the platform adapter, not raw window.open. Inside the + // Telegram WebView, window.open is intercepted by the client and the + // new-tab fallback is blocked on most platforms (Android, iOS). The + // TelegramAdapter dispatches to the WebApp SDK's openTelegramLink in + // Telegram and falls back to window.open in the standalone web build. const handleOpenBot = () => { if (deepLink) { - window.open(deepLink, '_blank', 'noopener,noreferrer'); + openTelegramLink(deepLink); } };