Skip to content

Commit

Permalink
routing - fix history state might be the wrong shape
Browse files Browse the repository at this point in the history
  • Loading branch information
s-cork committed Sep 5, 2024
1 parent 09341f6 commit 38c14db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client_code/routing/_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 38c14db

Please # to comment.