web: fix auto navigation on scale change for about & settings pages

This commit is contained in:
wukko
2024-09-04 21:20:56 +06:00
parent 140683a679
commit 520725462a
7 changed files with 19 additions and 33 deletions

View File

@@ -2,12 +2,12 @@
import { onMount } from "svelte";
import { page } from "$app/stores";
import { goto } from "$app/navigation";
import { defaultSettingsPage } from "$lib/subnav";
import { defaultNavPage } from "$lib/subnav";
onMount(() => {
if ($page.error?.message === "Not Found") {
if ($page.url.pathname.startsWith("/settings")) {
goto(defaultSettingsPage(), { replaceState: true });
goto(defaultNavPage("settings"), { replaceState: true });
} else {
goto("/", { replaceState: true });
}