Skip to content

Commit 0c313d5

Browse files
Fix browser history for initial page view via link (#238)
1 parent a56b40f commit 0c313d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/router/Router.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
if (isValidPath(path)) {
7575
navigate(path);
7676
} else {
77-
history.replaceState({}, '', Paths.HOME);
77+
const url = window.location.origin + import.meta.env.BASE_URL;
78+
history.replaceState({ path: Paths.HOME }, '', url);
7879
}
7980
};
8081
navigateFromUrl();

0 commit comments

Comments
 (0)