From f009da7de41e691692b407394a858a625efc35a3 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Tue, 3 Sep 2024 13:30:32 +0000 Subject: [PATCH] web: wrap error handler in onMount --- web/src/routes/+error.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/routes/+error.svelte b/web/src/routes/+error.svelte index e0d7c610..7b6d52e4 100644 --- a/web/src/routes/+error.svelte +++ b/web/src/routes/+error.svelte @@ -2,8 +2,9 @@ import { goto } from "$app/navigation"; import { page } from "$app/stores"; import { defaultSettingsPage } from "$lib/settings/defaults"; + import { onMount } from "svelte"; - $: { + onMount(() => { if ($page.error?.message === "Not Found") { if ($page.url.pathname.startsWith("/settings")) { goto(defaultSettingsPage(), { replaceState: true }); @@ -11,5 +12,5 @@ goto("/", { replaceState: true }); } } - } + });