From c6c2dbca12757a9db8ff209fa8ecd73fd4b99d56 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Sun, 16 Feb 2025 17:38:16 +1300 Subject: [PATCH] Fixed default page not letting you go home --- materialious/src/routes/+layout.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/materialious/src/routes/+layout.ts b/materialious/src/routes/+layout.ts index eedd356d..63cd57b5 100644 --- a/materialious/src/routes/+layout.ts +++ b/materialious/src/routes/+layout.ts @@ -21,13 +21,19 @@ export async function load({ url }) { } catch { } } + if (browser) { + locale.set(window.navigator.language); + } + await waitLocale(); + const defaultPage = get(interfaceDefaultPage); if ( defaultPage && defaultPage !== '/' && defaultPage.startsWith('/') && - url.pathname === '/' + url.pathname === '/' && + window.history.length < 3 ) { getPages().forEach((page) => { if (page.href === defaultPage && (!page.requiresAuth || get(authStore))) { @@ -35,9 +41,4 @@ export async function load({ url }) { } }); } - - if (browser) { - locale.set(window.navigator.language); - } - await waitLocale(); }