From 5c8d12ab25e878d0960ea73ee178f5fe6f569b0c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 17 Jul 2020 10:49:57 +0100 Subject: [PATCH 1/2] Null guard no e2ee for UserInfo Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/right_panel/UserInfo.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/views/right_panel/UserInfo.js b/src/components/views/right_panel/UserInfo.js index 1fd5221cdb..71e6266264 100644 --- a/src/components/views/right_panel/UserInfo.js +++ b/src/components/views/right_panel/UserInfo.js @@ -1287,11 +1287,11 @@ const BasicUserInfo = ({room, member, groupId, devices, isRoomEncrypted}) => { ); // only display the devices list if our client supports E2E - const _enableDevices = cli.isCryptoEnabled(); + const cryptoEnabled = cli.isCryptoEnabled(); let text; if (!isRoomEncrypted) { - if (!_enableDevices) { + if (!cryptoEnabled) { text = _t("This client does not support end-to-end encryption."); } else if (room) { text = _t("Messages in this room are not end-to-end encrypted."); @@ -1305,8 +1305,8 @@ const BasicUserInfo = ({room, member, groupId, devices, isRoomEncrypted}) => { let verifyButton; const homeserverSupportsCrossSigning = useHomeserverSupportsCrossSigning(cli); - const userTrust = cli.checkUserTrust(member.userId); - const userVerified = userTrust.isCrossSigningVerified(); + const userTrust = cryptoEnabled && cli.checkUserTrust(member.userId); + const userVerified = cryptoEnabled && userTrust.isCrossSigningVerified(); const isMe = member.userId === cli.getUserId(); const canVerify = homeserverSupportsCrossSigning && !userVerified && !isMe; @@ -1345,10 +1345,10 @@ const BasicUserInfo = ({room, member, groupId, devices, isRoomEncrypted}) => {
{ text }
{ verifyButton } -