From cbf27fc88779406c537f5e73dfec5e7a6ed3a1e1 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 20 Sep 2023 17:40:37 +0100 Subject: [PATCH] Also use return value password in the other hook --- src/e2ee/sharedKeyManagement.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/e2ee/sharedKeyManagement.ts b/src/e2ee/sharedKeyManagement.ts index 08d86e30..1c7cd4b6 100644 --- a/src/e2ee/sharedKeyManagement.ts +++ b/src/e2ee/sharedKeyManagement.ts @@ -63,7 +63,7 @@ export const useRoomSharedKey = (roomId: string): string | null => { export const useManageRoomSharedKey = (roomId: string): string | null => { const urlParams = useUrlParams(); - useKeyFromUrl(roomId); + const urlPassword = useKeyFromUrl(roomId); const [e2eeSharedKey] = useInternalRoomSharedKey(roomId); @@ -80,7 +80,7 @@ export const useManageRoomSharedKey = (roomId: string): string | null => { location.replace((hashStart ?? "") + (hashEnd ?? "")); }, [urlParams, e2eeSharedKey]); - return e2eeSharedKey; + return e2eeSharedKey ?? urlPassword; }; export const useIsRoomE2EE = (roomId: string): boolean | null => {