web/settings: redirect to full page if base page is opened on desktop

This commit is contained in:
dumbmoron 2024-07-04 22:25:22 +00:00
parent 16c76e7e92
commit 157b687ab5
No known key found for this signature in database

View file

@ -13,6 +13,8 @@
import IconFileSettings from "@tabler/icons-svelte/IconFileSettings.svelte"; import IconFileSettings from "@tabler/icons-svelte/IconFileSettings.svelte";
import IconChevronLeft from "@tabler/icons-svelte/IconChevronLeft.svelte"; import IconChevronLeft from "@tabler/icons-svelte/IconChevronLeft.svelte";
import { goto } from "$app/navigation";
import { defaultSettingsPage } from "$lib/settings/defaults";
let screenWidth: number; let screenWidth: number;
@ -21,7 +23,13 @@
currentPageTitle !== "settings" ? ` / ${$t(`settings.page.${currentPageTitle}`)}` : ""; currentPageTitle !== "settings" ? ` / ${$t(`settings.page.${currentPageTitle}`)}` : "";
$: isMobile = screenWidth <= 750; $: isMobile = screenWidth <= 750;
$: isHome = $page.url.pathname === `/settings`; $: isHome = $page.url.pathname === '/settings';
$: {
if (!isMobile && isHome) {
goto(defaultSettingsPage(), { replaceState: true });
}
}
</script> </script>
<svelte:head> <svelte:head>