Merge pull request #1351 from vector-im/SimonBrandner/fix/e2ee-embed
This commit is contained in:
@@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user