mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-16 07:41:31 +03:00
Update onEncryptionChange dialog
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
0e4ea97050
commit
d7acaa9fb0
2 changed files with 32 additions and 13 deletions
|
@ -128,16 +128,34 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
|||
|
||||
private onEncryptionChange = async () => {
|
||||
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 dialog = Modal.createTrackedDialog('Confirm Public Encrypted Room', '', QuestionDialog, {
|
||||
title: _t('Are you sure you want to add encryption to this public room?'),
|
||||
description: <div>
|
||||
<p> { _t(
|
||||
"<b> It’s not recommended to turn on encryption on for public rooms. </b>" +
|
||||
"Anyone can find and join public rooms, so anyone can read messages. You’ll " +
|
||||
"get none of the benefits of encryption, and you won't be able to turn it " +
|
||||
"off later. Encrypting messages in a public room will also likely make " +
|
||||
"receiving and sending messages slower than necessary.",
|
||||
null,
|
||||
{ "b": (sub) => <b> { sub } </b> },
|
||||
)} </p>
|
||||
<p> { _t(
|
||||
"To avoid these issues, create a <a> new private encrypted room </a> for " +
|
||||
"the conversation you plan to have.",
|
||||
null,
|
||||
{ "a": (sub) => <a onClick={() => {
|
||||
dialog.close();
|
||||
this.createNewRoom(false, true);
|
||||
}}> {sub} </a> },
|
||||
)} </p>
|
||||
</div>,
|
||||
|
||||
});
|
||||
|
||||
const { finished } = dialog;
|
||||
const [confirm] = await finished;
|
||||
|
||||
if (!confirm) {
|
||||
this.setState({ encrypted: false });
|
||||
return;
|
||||
|
@ -264,12 +282,12 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
|||
});
|
||||
};
|
||||
|
||||
private createNewRoom = async (defaultPublic: boolean) => {
|
||||
private createNewRoom = async (defaultPublic: boolean, defaultEncrypted: boolean) => {
|
||||
const modal = Modal.createTrackedDialog<[boolean, IOpts]>(
|
||||
"Create Room",
|
||||
"Create room after trying to make an E2EE room public",
|
||||
CreateRoomDialog,
|
||||
{ defaultPublic },
|
||||
{ defaultPublic, defaultEncrypted },
|
||||
);
|
||||
const [shouldCreate, opts] = await modal.finished;
|
||||
if (shouldCreate) {
|
||||
|
@ -301,7 +319,7 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
|||
null,
|
||||
{ "a": (sub) => <a onClick={() => {
|
||||
dialog.close();
|
||||
this.createNewRoom(true);
|
||||
this.createNewRoom(true, false);
|
||||
}}> {sub} </a> },
|
||||
)} </p>
|
||||
</div>,
|
||||
|
|
|
@ -1433,8 +1433,9 @@
|
|||
"Roles & Permissions": "Roles & Permissions",
|
||||
"Permissions": "Permissions",
|
||||
"Select the roles required to change various parts of the room": "Select the roles required to change various parts of the room",
|
||||
"Enable encryption in a public room?": "Enable encryption in a public room?",
|
||||
"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.": "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.",
|
||||
"Are you sure you want to add encryption to this public room?": "Are you sure you want to add encryption to this public room?",
|
||||
"<b> It’s not recommended to turn on encryption on for public rooms. </b>Anyone can find and join public rooms, so anyone can read messages. You’ll get none of the benefits of encryption, and you won't be able to turn it off later. Encrypting messages in a public room will also likely make receiving and sending messages slower than necessary.": "<b> It’s not recommended to turn on encryption on for public rooms. </b>Anyone can find and join public rooms, so anyone can read messages. You’ll get none of the benefits of encryption, and you won't be able to turn it off later. Encrypting messages in a public room will also likely make receiving and sending messages slower than necessary.",
|
||||
"To avoid these issues, create a <a> new private encrypted room </a> for the conversation you plan to have.": "To avoid these issues, create a <a> new private encrypted room </a> for the conversation you plan to have.",
|
||||
"Enable encryption?": "Enable encryption?",
|
||||
"Once enabled, encryption for a room cannot be disabled. Messages sent in an encrypted room cannot be seen by the server, only by the participants of the room. Enabling encryption may prevent many bots and bridges from working correctly. <a>Learn more about encryption.</a>": "Once enabled, encryption for a room cannot be disabled. Messages sent in an encrypted room cannot be seen by the server, only by the participants of the room. Enabling encryption may prevent many bots and bridges from working correctly. <a>Learn more about encryption.</a>",
|
||||
"Are you sure you want to make this encrypted room public?": "Are you sure you want to make this encrypted room public?",
|
||||
|
|
Loading…
Reference in a new issue