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}