Fix prettier issues

This commit is contained in:
CEC
2022-04-21 14:45:34 +02:00
parent bc17b86ce4
commit 91e8fa7cd4
8 changed files with 21 additions and 29 deletions
+4 -11
View File
@@ -8,17 +8,10 @@
import logoImg from "../images/logo-min-white.png";
let logo = gameManager?.currentStartedRoom?.loginSceneLogo ?? logoImg;
import reload from "../images/reload.png";
import external from "../images/external-link.png";
import { connectionManager } from "../../Connexion/ConnectionManager";
let errorScreen = get(errorScreenStore);
function click() {
if (errorScreen.urlToRedirect) {
if (errorScreen.urlToRedirect === "/login") void connectionManager.logout();
else window.location.assign(errorScreen.urlToRedirect);
} else if (errorScreen.type === "redirect" && window.history.length > 2) history.back();
else window.location.reload();
window.location.reload();
}
let details = errorScreen.details;
let timeVar = errorScreen.timeToRetry ?? 0;
@@ -31,7 +24,7 @@
onDestroy(() => clearInterval(interval));
}
$: detailsStylized = details.replace("{time}", `${timeVar / 1000}`);
$: detailsStylized = (details ?? "").replace("{time}", `${timeVar / 1000}`);
</script>
<main class="errorScreen" transition:fly={{ y: -200, duration: 500 }}>
@@ -44,9 +37,9 @@
<p class="details">
{detailsStylized}{#if $errorScreenStore.type === "retry"}<div class="loading" />{/if}
</p>
{#if ($errorScreenStore.type === "retry" && $errorScreenStore.canRetryManual) || ($errorScreenStore.type === "unauthorized" && $errorScreenStore.urlToRedirect && $errorScreenStore.buttonTitle) || ($errorScreenStore.type === "redirect" && (window.history.length > 2 || $errorScreenStore.urlToRedirect))}
{#if $errorScreenStore.type === "retry" && $errorScreenStore.canRetryManual}
<button type="button" class="nes-btn is-primary button" on:click={click}>
<img src={$errorScreenStore.type === "retry" ? reload : external} alt="" class="reload" />
<img src={reload} alt="" class="reload" />
{$errorScreenStore.buttonTitle}
</button>
{/if}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

+2 -2
View File
@@ -49,9 +49,9 @@ export class EntryScene extends Scene {
.catch((err) => {
const errorType = isErrorApiData.safeParse(err?.response?.data);
if (errorType.success) {
if (errorType.data.type === 'unauthorized') {
if (errorType.data.type === "unauthorized") {
void connectionManager.logout();
} else if (errorType.data.type === 'redirect') {
} else if (errorType.data.type === "redirect") {
window.location.assign(errorType.data.urlToRedirect);
} else errorScreenStore.setError(err?.response?.data);
} else {
+1 -1
View File
@@ -10,7 +10,7 @@ function createErrorScreenStore() {
return {
subscribe,
setError: (e: ErrorScreenMessage): void => {
set(e)
set(e);
},
};
}