Skip to content

Commit

Permalink
fix: restore connectRouter function
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Jul 11, 2024
1 parent 2eb208f commit 404b861
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,12 @@ function connectRouter(router: Router): void {
const initialUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}`
router.navigateByUrl(initialUrl)
let lastUrl = initialUrl
// const observer = new EventsTopic()
// observer.pipe(filter((e) => e.type === 'navigated')).subscribe(() => {
// const routerUrl = `${location.pathname.substring(
// getLocation().deploymentPath.length
// )}${location.search}`;
// if (routerUrl !== lastUrl) {
// lastUrl = routerUrl;
// router.navigateByUrl(routerUrl);
// }
// });
const observer = new EventsTopic()
observer.pipe(filter((e) => e.type === 'navigated')).subscribe(() => {
const routerUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}`
if (routerUrl !== lastUrl) {
lastUrl = routerUrl
router.navigateByUrl(routerUrl)
}
})
}

0 comments on commit 404b861

Please sign in to comment.