Skip to content

Commit 60fc8fd

Browse files
authoredNov 22, 2023
fix(client): no onAfterRouteChanged called after popstate (#3227)
closes #3226
1 parent ef6d8d1 commit 60fc8fd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/client/app/router.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,12 @@ export function createRouter(
222222
{ capture: true }
223223
)
224224

225-
window.addEventListener('popstate', (e) => {
226-
loadPage(
225+
window.addEventListener('popstate', async (e) => {
226+
await loadPage(
227227
normalizeHref(location.href),
228228
(e.state && e.state.scrollPosition) || 0
229229
)
230+
router.onAfterRouteChanged?.(location.href)
230231
})
231232

232233
window.addEventListener('hashchange', (e) => {

0 commit comments

Comments
 (0)
Please sign in to comment.