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
No known key found for this signature in database
GPG Key ID: D1D45825D60C24D2

View File

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