diff --git a/frontend/src/routes/company/[id]/+page.svelte b/frontend/src/routes/company/[id]/+page.svelte index ef112e0..8f7b15a 100644 --- a/frontend/src/routes/company/[id]/+page.svelte +++ b/frontend/src/routes/company/[id]/+page.svelte @@ -66,7 +66,10 @@ const selectTab = (id) => { active = id; - window.location.hash = id; + // replace the current history entry instead of pushing a new one, so + // switching tabs does not stack up history and the back button leaves + // the page rather than walking back through each visited tab + history.replaceState(history.state, '', `#${id}`); }; const load = async () => { diff --git a/frontend/src/routes/settings/+page.svelte b/frontend/src/routes/settings/+page.svelte index effb9a1..9b70a05 100644 --- a/frontend/src/routes/settings/+page.svelte +++ b/frontend/src/routes/settings/+page.svelte @@ -53,7 +53,10 @@ const selectTab = (id) => { active = id; - window.location.hash = id; + // replace the current history entry instead of pushing a new one, so + // switching tabs does not stack up history and the back button leaves + // the page rather than walking back through each visited tab + history.replaceState(history.state, '', `#${id}`); };