web/settings: redirect to full page if base page is opened on desktop
This commit is contained in:
parent
16c76e7e92
commit
157b687ab5
1 changed files with 9 additions and 1 deletions
|
@ -13,6 +13,8 @@
|
|||
import IconFileSettings from "@tabler/icons-svelte/IconFileSettings.svelte";
|
||||
|
||||
import IconChevronLeft from "@tabler/icons-svelte/IconChevronLeft.svelte";
|
||||
import { goto } from "$app/navigation";
|
||||
import { defaultSettingsPage } from "$lib/settings/defaults";
|
||||
|
||||
let screenWidth: number;
|
||||
|
||||
|
@ -21,7 +23,13 @@
|
|||
currentPageTitle !== "settings" ? ` / ${$t(`settings.page.${currentPageTitle}`)}` : "";
|
||||
|
||||
$: isMobile = screenWidth <= 750;
|
||||
$: isHome = $page.url.pathname === `/settings`;
|
||||
$: isHome = $page.url.pathname === '/settings';
|
||||
$: {
|
||||
if (!isMobile && isHome) {
|
||||
goto(defaultSettingsPage(), { replaceState: true });
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
|
Loading…
Reference in a new issue