mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-11 19:24:27 +02:00
19 lines
651 B
Svelte
19 lines
651 B
Svelte
<script lang="ts">
|
|
import { onMount } from "svelte";
|
|
import { page } from "$app/stores";
|
|
import { goto } from "$app/navigation";
|
|
import { defaultNavPage } from "$lib/subnav";
|
|
|
|
onMount(() => {
|
|
if ($page.error?.message === "Not Found") {
|
|
if ($page.url.pathname.startsWith("/settings")) {
|
|
goto(defaultNavPage("settings"), { replaceState: true });
|
|
} else if ($page.url.pathname.startsWith("/about")) {
|
|
goto(defaultNavPage("about"), { replaceState: true });
|
|
} else {
|
|
goto("/", { replaceState: true });
|
|
}
|
|
}
|
|
});
|
|
</script>
|