mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
web/mainscreen: ensure back button goes to room lsit after update
This commit is contained in:
parent
79a4a6cb48
commit
79349cffc1
1 changed files with 3 additions and 1 deletions
|
@ -164,7 +164,9 @@ const handleURLHash = (client: Client) => {
|
|||
}
|
||||
const state = JSON.parse(newURL.searchParams.get("state") || "{}")
|
||||
newURL.search = ""
|
||||
history.replaceState(state, "", newURL.toString())
|
||||
// Set an extra empty state to ensure back button goes to room list instead of reloading the page.
|
||||
history.replaceState({}, "", newURL.toString())
|
||||
history.pushState(state, "")
|
||||
return state
|
||||
}
|
||||
return history.state
|
||||
|
|
Loading…
Add table
Reference in a new issue