diff --git a/ui/src/components/StaleInviteModal.svelte b/ui/src/components/StaleInviteModal.svelte index f8a266b..1ababd8 100644 --- a/ui/src/components/StaleInviteModal.svelte +++ b/ui/src/components/StaleInviteModal.svelte @@ -1,8 +1,10 @@ -{#if app.staleInvite} +{#if app.staleInvite && ready && !(insideTelegram() && telegramDialogsAvailable())}

{parts[0]}{#if username}{/if}{parts[1] ?? ''}

diff --git a/ui/src/components/WelcomeRedeemModal.svelte b/ui/src/components/WelcomeRedeemModal.svelte index 7783c5c..9cbc2d9 100644 --- a/ui/src/components/WelcomeRedeemModal.svelte +++ b/ui/src/components/WelcomeRedeemModal.svelte @@ -1,8 +1,10 @@ -{#if app.welcomeRedeem} +{#if app.welcomeRedeem && ready && !(insideTelegram() && telegramDialogsAvailable())}

{parts[0]}{#if username}{/if}{parts[1] ?? ''}

diff --git a/ui/src/game/Game.svelte b/ui/src/game/Game.svelte index 67e1a09..5170c49 100644 --- a/ui/src/game/Game.svelte +++ b/ui/src/game/Game.svelte @@ -24,7 +24,7 @@ import { getCachedGame, setCachedGame, setCachedDraft, type CachedGame } from '../lib/gamecache'; import { patchLobbyGame } from '../lib/lobbycache'; import { applyGameOver, applyMoveDelta, applyOpponentJoined, type DeltaResult } from '../lib/gamedelta'; - import { telegramHaptic } from '../lib/telegram'; + import { insideTelegram, telegramDialogsAvailable, telegramHaptic, telegramShowConfirm } from '../lib/telegram'; import { BLANK, newPlacement, @@ -712,6 +712,16 @@ busy = false; } } + // onResignClick: inside the Mini App (and online) confirm with Telegram's native dialog and resign + // on accept; otherwise open the in-app confirm modal (which also carries the offline-disabled action). + async function onResignClick(): Promise { + if (connection.online && insideTelegram() && telegramDialogsAvailable()) { + if (await telegramShowConfirm(t('game.confirmResign'))) doResign(); + return; + } + resignOpen = true; + } + async function doResign() { resignOpen = false; busy = true; @@ -1149,7 +1159,7 @@ {/if} {:else} - + {/if} {#if !view.game.multipleWordsPerTurn}{t('game.oneWordRule')}{/if}