From 89ae0e1e62d31bc1122bca85b19d7fd6b6437c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 8 Aug 2023 14:08:37 +0200 Subject: [PATCH] Re-use variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/UrlParams.ts | 2 +- src/room/GroupCallView.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UrlParams.ts b/src/UrlParams.ts index 80f91de0..82a08801 100644 --- a/src/UrlParams.ts +++ b/src/UrlParams.ts @@ -19,7 +19,7 @@ import { useLocation } from "react-router-dom"; import { Config } from "./config/Config"; -const PASSWORD_STRING = "?password="; +export const PASSWORD_STRING = "?password="; interface UrlParams { roomAlias: string | null; diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 0726d818..2ab942d3 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -39,7 +39,7 @@ import { Config } from "../config/Config"; import { MuteStates, useMuteStates } from "./MuteStates"; import { useMediaDevices, MediaDevices } from "../livekit/MediaDevicesContext"; import { useRoomSharedKey } from "../e2ee/sharedKeyManagement"; -import { useUrlParams } from "../UrlParams"; +import { PASSWORD_STRING, useUrlParams } from "../UrlParams"; declare global { interface Window { @@ -258,7 +258,7 @@ export function GroupCallView({ useEffect(() => { const originalHash = location.hash; const hash = originalHash === "" ? "#" : originalHash; - const [hashStart, password] = hash.split("?password="); + const [hashStart, password] = hash.split(PASSWORD_STRING); if (password !== e2eeSharedKey) return;