From 157b687ab5fbd7f9213d47fb33afa3a9ee6284ec Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Thu, 4 Jul 2024 22:25:22 +0000 Subject: [PATCH] web/settings: redirect to full page if base page is opened on desktop --- web/src/routes/settings/+layout.svelte | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/src/routes/settings/+layout.svelte b/web/src/routes/settings/+layout.svelte index 819938a6..65c1fb4e 100644 --- a/web/src/routes/settings/+layout.svelte +++ b/web/src/routes/settings/+layout.svelte @@ -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 }); + } + } +