Add second Confirm Public Encrypted Room dialog

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-02-28 08:29:31 +01:00
parent 0d9bc00968
commit 5d6bc9a886
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -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(