Skip to content

Commit

Permalink
fix: don't push "/404" to history
Browse files Browse the repository at this point in the history
  • Loading branch information
pmelab committed Sep 25, 2024
1 parent f094430 commit 4671527
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/waku/src/router/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,16 @@ const InnerRouter = ({ routerData }: { routerData: RouterData }) => {
url.pathname = path;
url.search = query;
url.hash = '';
window.history.pushState(
{
...window.history.state,
waku_new_path: url.pathname !== window.location.pathname,
},
'',
url,
);
if (path !== '/404') {
window.history.pushState(
{
...window.history.state,
waku_new_path: url.pathname !== window.location.pathname,
},
'',
url,
);
}
changeRoute(parseRoute(url), { skipRefetch: true });
};
const listeners = (routerData[1] ||= new Set());
Expand Down

0 comments on commit 4671527

Please sign in to comment.