diff --git a/src/main.ts b/src/main.ts index 2b8b24f..b4d0b23 100644 --- a/src/main.ts +++ b/src/main.ts @@ -216,7 +216,11 @@ const route = (path: string) => { // onload route(location.pathname); -history.pushState({}, '', location.pathname); + +// only push a new entry if there is no history onload +if (!history.length) { + history.pushState({}, '', location.pathname); +} window.addEventListener('popstate', (event) => { route(location.pathname);