diff --git a/docs/FUNCTIONAL.md b/docs/FUNCTIONAL.md index 7bef505..196ad0a 100644 --- a/docs/FUNCTIONAL.md +++ b/docs/FUNCTIONAL.md @@ -109,7 +109,9 @@ two accounts share a game still in progress. The profile lists the account's **sign-in methods**. On the web a player can add Telegram (a login-widget popup) or VK (VK ID web login — a redirect to VK's sign-in and -back); inside a Mini App the host platform is already linked. Linking a provider that +back); inside a Mini App the host platform is already linked, and its own sign-in-method +row is hidden — the platform the player is currently signed in through cannot be unlinked +from there, only the other provider's row is shown. Linking a provider that already belongs to another account offers the same irreversible **merge** as email linking. A linked provider can be **unlinked** — except the last remaining sign-in method, which is refused so the account stays reachable. **Email is diff --git a/docs/FUNCTIONAL_ru.md b/docs/FUNCTIONAL_ru.md index 4e32af7..ff23181 100644 --- a/docs/FUNCTIONAL_ru.md +++ b/docs/FUNCTIONAL_ru.md @@ -113,7 +113,9 @@ Telegram держит **единого бота**: все игроки поль В профиле перечислены **способы входа** аккаунта. В вебе игрок может добавить Telegram (попап логин-виджета) или VK (веб-вход VK ID — редирект на страницу входа VK и -обратно); внутри Mini App платформа-хозяин уже привязана. Привязка провайдера, уже +обратно); внутри Mini App платформа-хозяин уже привязана, и её собственная плашка способа +входа скрыта — платформу, через которую игрок сейчас вошёл, отсюда отвязать нельзя, +показывается только плашка другого провайдера. Привязка провайдера, уже принадлежащего другому аккаунту, предлагает то же необратимое **слияние**, что и привязка email. Привязанного провайдера можно **отвязать** — кроме последнего оставшегося способа входа: он не отвязывается, чтобы аккаунт оставался достижимым. diff --git a/ui/src/screens/Profile.svelte b/ui/src/screens/Profile.svelte index b5f1d28..525be5f 100644 --- a/ui/src/screens/Profile.svelte +++ b/ui/src/screens/Profile.svelte @@ -13,7 +13,8 @@ import { GatewayError } from '../lib/client'; import { connection } from '../lib/connection.svelte'; import { gateway } from '../lib/gateway'; - import { loginWidgetAvailable, requestTelegramLogin } from '../lib/telegram'; + import { insideTelegram, loginWidgetAvailable, requestTelegramLogin } from '../lib/telegram'; + import { insideVK } from '../lib/vk'; import { startVKLink, vkWebLinkAvailable } from '../lib/vkid'; import { t } from '../lib/i18n/index.svelte'; import { @@ -58,6 +59,11 @@ let deletePhrase = $state(''); const telegramLinkable = loginWidgetAvailable(); const vkLinkable = vkWebLinkAvailable(); + // Inside a host Mini App the current platform's own identity must not be managed from the + // profile — unlinking the very platform you are signed in through is meaningless — so that + // provider's linked-account row is hidden here (the web / native builds still show both). + const hostTelegram = insideTelegram(); + const hostVK = insideVK(); function defaultTz(): string { const b = browserOffset(); @@ -392,8 +398,10 @@ + host provider is already linked, so its own row is hidden — the platform you are signed + in through cannot be unlinked from here (the other provider's row still shows). Email is + never unlinked — it is changed. Unlink is offered only when another identity remains + (the backend also refuses the last one). -->

{t('profile.accountsTitle')}

@@ -440,7 +448,7 @@ {/if} - {#if p.telegramLinked} + {#if p.telegramLinked && !hostTelegram}
Telegram {#if canUnlink} @@ -453,7 +461,7 @@ {/if} - {#if p.vkLinked} + {#if p.vkLinked && !hostVK}
VK {#if canUnlink}