From 5d6bc9a88663463587768c49495e8c03e8f77a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sun, 28 Feb 2021 08:29:31 +0100 Subject: [PATCH] Add second Confirm Public Encrypted Room dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- .../tabs/room/SecurityRoomSettingsTab.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js index b1be77064a..e3c23c890c 100644 --- a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js +++ b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js @@ -91,7 +91,24 @@ export default class SecurityRoomSettingsTab extends React.Component { if (refreshWhenTypes.includes(e.getType())) this.forceUpdate(); }; - _onEncryptionChange = (e) => { + _onEncryptionChange = async (e) => { + if (this.state.joinRule == "public") { + const {finished} = Modal.createTrackedDialog('Confirm Public Encrypted Room', '', QuestionDialog, { + title: _t('Enable encryption in a public room?'), + description: _t( + "Note that enabling encryption in public rooms renders the " + + "encryption pointless, wastes processing power, and can cause " + + "performance problems. Please consider creating a separate " + + "encrypted room.", + ), + }); + const [confirm] = await finished; + if (!confirm) { + this.setState({encrypted: false}); + return; + } + } + Modal.createTrackedDialog('Enable encryption', '', QuestionDialog, { title: _t('Enable encryption?'), description: _t(