diff --git a/web/src/ui/MainScreen.tsx b/web/src/ui/MainScreen.tsx index 6b207b8..3683a55 100644 --- a/web/src/ui/MainScreen.tsx +++ b/web/src/ui/MainScreen.tsx @@ -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