Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/client/app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function createRouter(
: link.href,
link.baseURI
)
const currentUrl = window.location
const currentUrl = new URL(window.location.href) // copy to keep old data
// only intercept inbound html links
if (
!e.ctrlKey &&
Expand Down Expand Up @@ -211,7 +211,12 @@ export function createRouter(
window.scrollTo(0, 0)
}
} else {
go(href)
go(href).then(() => {
// do after the route is changed so location.hash in theme code is the new hash
if (hash !== currentUrl.hash) {
window.dispatchEvent(new Event('hashchange'))
}
})
}
}
}
Expand Down