diff --git a/frontend/src/lib/common/framework/ui/ErrorPage.svelte b/frontend/src/lib/common/framework/ui/ErrorPage.svelte new file mode 100644 index 0000000..e097286 --- /dev/null +++ b/frontend/src/lib/common/framework/ui/ErrorPage.svelte @@ -0,0 +1,14 @@ +
+
+

404

+

+
+
+ Not +
+ Found. +

+
+
diff --git a/frontend/src/routes/+error.svelte b/frontend/src/routes/+error.svelte index 5881914..4d78c58 100644 --- a/frontend/src/routes/+error.svelte +++ b/frontend/src/routes/+error.svelte @@ -1,14 +1,5 @@ -
-
-

404

-

-
-
- Not -
- Found. -

-
-
+ + + diff --git a/frontend/src/routes/dashboard/+layout.svelte b/frontend/src/routes/dashboard/+layout.svelte index 296fef2..5c2313c 100644 --- a/frontend/src/routes/dashboard/+layout.svelte +++ b/frontend/src/routes/dashboard/+layout.svelte @@ -8,6 +8,7 @@ import { onMount, setContext } from 'svelte'; import type { LayoutProps } from './$types'; import { StatusType } from '$lib/common/adapter/presenter/asyncState'; + import ErrorPage from '$lib/common/framework/ui/ErrorPage.svelte'; const { children }: LayoutProps = $props(); @@ -18,10 +19,12 @@ setContext(AuthBloc.name, authBloc); - const authState = $derived($authBloc); - onMount(() => authBloc.dispatch({ event: AuthEventType.CurrentUserLoadedEvent })); + const authState = $derived($authBloc); + const isLoading = $derived.by( + () => authState.status === StatusType.Loading || authState.status === StatusType.Idle + ); const hasError = $derived.by(() => { if (authState.status === StatusType.Error) { return true; @@ -33,8 +36,10 @@ }); -{#if hasError} -
Error
+{#if isLoading} +
+{:else if hasError} + {:else} {@render children()} {/if}