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,14 +2,14 @@
import { page } from "$app/stores";
import { goto } from "$app/navigation";
import { browser } from "$app/environment";
import { defaultNavPage } from "$lib/subnav";
import { t } from "$lib/i18n/translations";
import IconArrowLeft from "@tabler/icons-svelte/IconArrowLeft.svelte";
export let pageName: string;
export let pageName: "settings" | "about";
export let homeNavPath: string;
export let homeDesktopPath: string;
export let homeTitle: string;
export let pageSubtitle = "";
export let contentPadding = false;
@ -27,7 +27,7 @@
$: isHome = $page.url.pathname === homeNavPath;
$: {
if (browser && !isMobile && isHome) {
goto(homeDesktopPath, { replaceState: true });
goto(defaultNavPage(pageName), { replaceState: true });
}
}
</script>