From 9d142c1ea598565535163b3285bc4433305a6673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Fri, 25 Aug 2023 15:30:58 +0200 Subject: [PATCH] Fix `useIsRoomE2EE()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/e2ee/sharedKeyManagement.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/e2ee/sharedKeyManagement.ts b/src/e2ee/sharedKeyManagement.ts index 3af56d6f..83eca2ea 100644 --- a/src/e2ee/sharedKeyManagement.ts +++ b/src/e2ee/sharedKeyManagement.ts @@ -67,15 +67,19 @@ export const useManageRoomSharedKey = (roomId: string): string | null => { }; export const useIsRoomE2EE = (roomId: string): boolean | null => { + const { isEmbedded } = useUrlParams(); const client = useClient(); const room = useMemo( () => client.client?.getRoom(roomId) ?? null, [roomId, client.client] ); - const isE2EE = useMemo( - () => (room ? !room?.getCanonicalAlias() : null), - [room] - ); + const isE2EE = useMemo(() => { + if (isEmbedded) { + return false; + } else { + return room ? !room?.getCanonicalAlias() : null; + } + }, [isEmbedded, room]); return isE2EE; };