Merge remote-tracking branch 'origin/livekit' into dbkr/matrixrtcsession

This commit is contained in:
David Baker
2023-08-25 14:40:52 +01:00

View File

@@ -67,15 +67,19 @@ export const useManageRoomSharedKey = (roomId: string): string | null => {
}; };
export const useIsRoomE2EE = (roomId: string): boolean | null => { export const useIsRoomE2EE = (roomId: string): boolean | null => {
const { isEmbedded } = useUrlParams();
const client = useClient(); const client = useClient();
const room = useMemo( const room = useMemo(
() => client.client?.getRoom(roomId) ?? null, () => client.client?.getRoom(roomId) ?? null,
[roomId, client.client] [roomId, client.client]
); );
const isE2EE = useMemo( const isE2EE = useMemo(() => {
() => (room ? !room?.getCanonicalAlias() : null), if (isEmbedded) {
[room] return false;
); } else {
return room ? !room?.getCanonicalAlias() : null;
}
}, [isEmbedded, room]);
return isE2EE; return isE2EE;
}; };