From d47aad2ead1ad1f16b652657e0cb155a6278de48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Cardinale?= Date: Wed, 4 May 2022 10:13:18 +0200 Subject: [PATCH] Change lost connection page to the new one (#2161) * Change lost connection page to the new one --- front/src/Components/UI/ErrorScreen.svelte | 52 ++++++++++++--------- front/src/Components/UI/images/error.png | Bin 0 -> 4422 bytes front/src/Phaser/Game/GameScene.ts | 29 ++++++++++-- front/src/Stores/ErrorScreenStore.ts | 5 +- front/src/i18n/de-DE/warning.ts | 2 + front/src/i18n/en-US/warning.ts | 2 + front/src/i18n/fr-FR/menu.ts | 2 +- front/src/i18n/fr-FR/warning.ts | 2 + front/src/i18n/zh-CN/warning.ts | 2 + 9 files changed, 67 insertions(+), 29 deletions(-) create mode 100644 front/src/Components/UI/images/error.png diff --git a/front/src/Components/UI/ErrorScreen.svelte b/front/src/Components/UI/ErrorScreen.svelte index 11ab8ca4..8056bf94 100644 --- a/front/src/Components/UI/ErrorScreen.svelte +++ b/front/src/Components/UI/ErrorScreen.svelte @@ -11,14 +11,17 @@ import reload from "../images/reload.png"; let errorScreen = get(errorScreenStore); + import error from "./images/error.png"; + let errorLogo = errorScreen?.image ?? error; + function click() { - if (errorScreen.type === "unauthorized") void connectionManager.logout(); + if (errorScreen?.type === "unauthorized") void connectionManager.logout(); else window.location.reload(); } - let details = errorScreen.details; - let timeVar = errorScreen.timeToRetry ?? 0; + let details = errorScreen?.details ?? ""; + let timeVar = errorScreen?.timeToRetry ?? 0; - if (errorScreen.type === "retry") { + if (errorScreen?.type === "retry") { let interval = setInterval(() => { if (timeVar <= 1000) click(); timeVar -= 1000; @@ -29,24 +32,29 @@ $: detailsStylized = (details ?? "").replace("{time}", `${timeVar / 1000}`); -
-
- -
- {#if $errorScreenStore.type !== "retry"}

{$errorScreenStore.title}

{/if} -

{$errorScreenStore.subtitle}

- {#if $errorScreenStore.type !== "retry"}

Code : {$errorScreenStore.code}

{/if} -

- {detailsStylized}{#if $errorScreenStore.type === "retry"}

{/if} -

- {#if ($errorScreenStore.type === "retry" && $errorScreenStore.canRetryManual) || $errorScreenStore.type === "unauthorized"} - - {/if} -
-
+{#if $errorScreenStore} +
+
+ +
Error logo
+ {#if $errorScreenStore.type !== "retry"}

{$errorScreenStore.title}

{/if} + {#if $errorScreenStore.subtitle}

{$errorScreenStore.subtitle}

{/if} + {#if $errorScreenStore.type !== "retry"}

Code : {$errorScreenStore.code}

{/if} +

+ {detailsStylized} + {#if $errorScreenStore.type === "retry" || $errorScreenStore.type === "reconnecting"} +

+ {/if} +

+ {#if ($errorScreenStore.type === "retry" && $errorScreenStore.canRetryManual) || $errorScreenStore.type === "unauthorized"} + + {/if} +
+
+{/if}