Fix double navigation bug in breadcrumbs

This commit is contained in:
2026-01-27 15:33:25 +01:00
parent 70a22d4a06
commit 0723cb5331
9 changed files with 40 additions and 45 deletions

View File

@@ -28,12 +28,16 @@ onMount(() => {
nav.open_node((window as any).initial_node as FSPath, false)
} else {
console.debug("No initial node, fetching path", window.location.pathname)
nav.navigate(decodeURI(window.location.pathname).replace(/^\/d/, ""), false)
nav.navigate(decodeURIComponent(window.location.pathname).replace(/^\/d/, ""), false)
}
// There is a global natigation handler which captures link clicks and loads
// the right svelte components. When a filesystem link is clicked this store
// is updated. Catch it and use the filesystem navigator to navigate to the
// right file
const page_sub = current_page_store.subscribe(() => {
console.debug("Caught page transition to", window.location.pathname)
nav.navigate(decodeURI(window.location.pathname).replace(/^\/d/, ""), false)
console.debug("Caught page transition to", window.location.pathname, "calling navigator")
nav.navigate(decodeURIComponent(window.location.pathname).replace(/^\/d/, ""), false)
})
// Subscribe to navigation updates. This function returns a deconstructor