update menu bar active nav path detection

This commit is contained in:
bytedream committed 2026-11-02 00:14:14 +01:00
1 parent ffa60e8cc5
commit 191d03c141
1 file changed
+2 -5
+2 -5
View File
@@ -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();
});
});