cobalt/web/src/routes/+error.svelte

16 lines
474 B
Svelte
Raw Normal View History

<script lang="ts">
2024-07-10 18:50:50 +01:00
import { goto } from "$app/navigation";
import { page } from "$app/stores";
import { defaultSettingsPage } from "$lib/settings/defaults";
$: {
2024-07-10 18:50:50 +01:00
if ($page.error?.message === "Not Found") {
if ($page.url.pathname.startsWith("/settings")) {
goto(defaultSettingsPage(), { replaceState: true });
} else {
goto("/", { replaceState: true });
}
}
}
</script>