mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
web: wrap error handler in onMount
This commit is contained in:
parent
93f8c038d2
commit
f009da7de4
|
@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue