From 59653fea07858296f3a4fed9d7a2917e61e9f2c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Fri, 4 Aug 2023 14:01:13 +0200 Subject: [PATCH] Update the URL the lobby view when the password changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/room/LobbyView.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/room/LobbyView.tsx b/src/room/LobbyView.tsx index 53bc170b..5880c362 100644 --- a/src/room/LobbyView.tsx +++ b/src/room/LobbyView.tsx @@ -79,6 +79,17 @@ export const LobbyView: FC = ({ [setE2EESharedKey] ); + useEffect(() => { + const originalHash = location.hash; + let hash = originalHash === "" ? "#" : originalHash; + hash = hash.split("?password=")[0]; + hash += `?password=${e2eeSharedKey ?? ""}`; + + if (originalHash !== hash) { + location.replace(hash); + } + }, [e2eeSharedKey]); + return (
{!hideHeader && (