From 191d03c14164d703e23077629a04220e2a17e050 Mon Sep 17 00:00:00 2001 From: bytedream Date: Mon, 2 Nov 2026 00:14:14 +0100 Subject: [PATCH] update menu bar active nav path detection --- src/app/layout/Menu.svelte | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/layout/Menu.svelte b/src/app/layout/Menu.svelte index 9138832..1e0172e 100644 --- a/src/app/layout/Menu.svelte +++ b/src/app/layout/Menu.svelte @@ -66,11 +66,6 @@ }); onMount(() => { - updateActiveNavPath(); - // the mutation observer callback runs too fast, hence the call to `updateActiveNavPath` must be wrapped in an empty - // setTimeout to not cause any visual bugs - new MutationObserver(() => setTimeout(updateActiveNavPath)).observe(document.head, { childList: true }); - document.addEventListener('astro:page-load', () => { pageLoadTimestamp = Date.now(); @@ -88,6 +83,8 @@ document.body.addEventListener('touchstart', touchStartListener); document.body.addEventListener('touchend', touchEndListener); + + updateActiveNavPath(); }); });