mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-28 18:46:09 +00:00
web/settings: redirect to full page if base page is opened on desktop
This commit is contained in:
parent
16c76e7e92
commit
157b687ab5
|
@ -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