Delete hash once loaded

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2023-08-08 14:04:35 +02:00
parent 8fdc1e3684
commit 9cd20ed1da

View File

@@ -257,14 +257,13 @@ export function GroupCallView({
useEffect(() => { useEffect(() => {
const originalHash = location.hash; const originalHash = location.hash;
let hash = originalHash === "" ? "#" : originalHash; const hash = originalHash === "" ? "#" : originalHash;
hash = hash.split("?password=")[0]; const [hashStart, password] = hash.split("?password=");
hash += `?password=${e2eeSharedKey ?? ""}`;
if (originalHash !== hash) { if (password !== e2eeSharedKey) return;
location.replace(hash);
} location.replace(hashStart);
}, [e2eeSharedKey]); }, [password, e2eeSharedKey]);
const e2eeConfig = useMemo( const e2eeConfig = useMemo(
() => (e2eeSharedKey ? { sharedKey: e2eeSharedKey } : undefined), () => (e2eeSharedKey ? { sharedKey: e2eeSharedKey } : undefined),