feat(cabinet): bulletproof Close button + kill the /login flash on the service-unavailable screen

Two Telegram-Mini-App follow-ups to the backend-unavailable screen:

- Reliable "Close" button (Telegram only) that actually EXITS the Mini App
  instead of routing back. closeTelegramApp() tries the legacy
  window.Telegram.WebApp.close() global (telegram-web-app.js), then the SDK
  closeMiniApp(), then the raw postEvent('web_app_close') — all emit the same
  close event, so it can't silently fail. Guarded so the first path never
  silently no-ops.
- Eliminate the flash of the /login page before the outage screen. On the
  bootstrap path (the app has never reached the backend) reportPossibleBackendDown()
  now flips the screen IMMEDIATELY and synchronously instead of waiting on the
  confirm probe, so the overlay is up before isLoading flips and /login can never
  paint uncovered. Add an eager checkBackendOnStartup() liveness ping at launch
  (parallel with auth) so even the no-stored-token / fresh-Telegram path that
  makes no early request shows the screen at once. The confirm-probe still guards
  already-loaded sessions from a one-off blip.

i18n close key added in ru/en/zh/fa.
This commit is contained in:
c0mrade
2026-06-04 13:06:05 +03:00
parent ac8a0fc41a
commit 7413837faf
9 changed files with 89 additions and 6 deletions

View File

@@ -4816,7 +4816,8 @@
"description": "We can't reach the service right now. It may be undergoing maintenance or there's a temporary connection issue.",
"retry": "Try again",
"checking": "Checking connection...",
"hint": "This page will refresh automatically as soon as the service is back."
"hint": "This page will refresh automatically as soon as the service is back.",
"close": "Close"
}
},
"merge": {

View File

@@ -4476,7 +4476,8 @@
"description": "در حال حاضر امکان اتصال به سرویس وجود ندارد. ممکن است در حال تعمیر باشد یا مشکل موقتی در اتصال وجود داشته باشد.",
"retry": "تلاش مجدد",
"checking": "در حال بررسی اتصال...",
"hint": "به‌محض در دسترس قرار گرفتن سرویس، این صفحه به‌طور خودکار بازخوانی می‌شود."
"hint": "به‌محض در دسترس قرار گرفتن سرویس، این صفحه به‌طور خودکار بازخوانی می‌شود.",
"close": "بستن"
}
},
"merge": {

View File

@@ -5371,7 +5371,8 @@
"description": "Не удаётся подключиться к сервису. Возможно, идут технические работы или временные неполадки со связью.",
"retry": "Повторить попытку",
"checking": "Проверяем соединение...",
"hint": "Страница обновится автоматически, как только сервис снова станет доступен."
"hint": "Страница обновится автоматически, как только сервис снова станет доступен.",
"close": "Закрыть"
}
},
"merge": {

View File

@@ -4357,7 +4357,8 @@
"description": "暂时无法连接到服务。可能正在进行维护,或存在临时的网络问题。",
"retry": "重试",
"checking": "正在检查连接...",
"hint": "服务恢复后,本页面将自动刷新。"
"hint": "服务恢复后,本页面将自动刷新。",
"close": "关闭"
}
},
"banSystem": {