mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
Fix useIsRoomE2EE()
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
a73516380a
commit
9d142c1ea5
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user