web/mainscreen: ensure back button goes to room lsit after update

This commit is contained in:
Tulir Asokan 2024-12-19 22:24:38 +02:00
parent 79a4a6cb48
commit 79349cffc1

View file

@ -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