diff --git a/client_code/routing/_navigation.py b/client_code/routing/_navigation.py index d6e0411d..cdfef619 100644 --- a/client_code/routing/_navigation.py +++ b/client_code/routing/_navigation.py @@ -15,6 +15,8 @@ # re-initialise the state object which was overridden on load or this is a new session state = history.state or {"url": location.hash, "pos": 0} +if "url" not in state: + state = {"url": location.hash, "pos": 0} history.replaceState(state, "", state["url"]) # undo and pos are used for unload behavior