diff --git a/apps/web/components/OpenBotButton.tsx b/apps/web/components/OpenBotButton.tsx index dcd96ff2..9371ec5d 100644 --- a/apps/web/components/OpenBotButton.tsx +++ b/apps/web/components/OpenBotButton.tsx @@ -14,6 +14,7 @@ export function OpenBotButton({ label, variant = "default", size = "sm" }: { lab const router = useRouter(); const [waiting, setWaiting] = useState(false); const [error, setError] = useState(null); + const [link, setLink] = useState(null); useEffect(() => { if (!waiting) return; @@ -35,8 +36,9 @@ export function OpenBotButton({ label, variant = "default", size = "sm" }: { lab setError(r.error ?? "Не получилось открыть бота"); return; } + // Popups blocked: never take Peppa away — show a link that opens in a new tab instead. if (tab) tab.location.href = r.url; - else window.location.href = r.url; + else setLink(r.url); setWaiting(true); } @@ -45,6 +47,11 @@ export function OpenBotButton({ label, variant = "default", size = "sm" }: { lab + {link && ( + + Браузер не открыл новую вкладку — нажмите здесь, чтобы открыть бота + + )} {waiting && Нажмите Start в Telegram и вернитесь сюда — шаг отметится сам.} {error && {error}}