From e973d18085fca050ea612c40594333c243326ebf Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 14 Jun 2016 11:57:08 +0100 Subject: [PATCH] Hide e2e features if not enabled Don't show the device info in the MemberInfo and UserSettings unless the user has ticked the 'labs' box. --- src/components/structures/UserSettings.js | 4 ++++ src/components/views/rooms/MemberInfo.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index a320a02da8..60f9898e35 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -258,6 +258,10 @@ module.exports = React.createClass({ }, _renderDeviceInfo: function() { + if (!UserSettingsStore.isFeatureEnabled("e2e_encryption")) { + return null; + } + var client = MatrixClientPeg.get(); var deviceId = client.deviceId; var olmKey = client.getDeviceEd25519Key() || ""; diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 1eee280eb5..97cfecc9e1 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -30,6 +30,7 @@ var MatrixClientPeg = require("../../../MatrixClientPeg"); var dis = require("../../../dispatcher"); var Modal = require("../../../Modal"); var sdk = require('../../../index'); +var UserSettingsStore = require('../../../UserSettingsStore'); var createRoom = require('../../../createRoom'); module.exports = React.createClass({ @@ -506,6 +507,10 @@ module.exports = React.createClass({ }, _renderDevices: function() { + if (!UserSettingsStore.isFeatureEnabled("e2e_encryption")) { + return null; + } + var devices = this.state.devices; var MemberDeviceInfo = sdk.getComponent('rooms.MemberDeviceInfo'); var Spinner = sdk.getComponent("elements.Spinner");