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 () => {
|
private onEncryptionChange = async () => {
|
||||||
if (this.state.joinRule == "public") {
|
if (this.state.joinRule == "public") {
|
||||||
const { finished } = Modal.createTrackedDialog('Confirm Public Encrypted Room', '', QuestionDialog, {
|
const dialog = Modal.createTrackedDialog('Confirm Public Encrypted Room', '', QuestionDialog, {
|
||||||
title: _t('Enable encryption in a public room?'),
|
title: _t('Are you sure you want to add encryption to this public room?'),
|
||||||
description: _t(
|
description: <div>
|
||||||
"Note that enabling encryption in public rooms renders the " +
|
<p> { _t(
|
||||||
"encryption pointless, wastes processing power, and can cause " +
|
"<b> It’s not recommended to turn on encryption on for public rooms. </b>" +
|
||||||
"performance problems. Please consider creating a separate " +
|
"Anyone can find and join public rooms, so anyone can read messages. You’ll " +
|
||||||
"encrypted room.",
|
"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;
|
const [confirm] = await finished;
|
||||||
|
|
||||||
if (!confirm) {
|
if (!confirm) {
|
||||||
this.setState({ encrypted: false });
|
this.setState({ encrypted: false });
|
||||||
return;
|
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]>(
|
const modal = Modal.createTrackedDialog<[boolean, IOpts]>(
|
||||||
"Create Room",
|
"Create Room",
|
||||||
"Create room after trying to make an E2EE room public",
|
"Create room after trying to make an E2EE room public",
|
||||||
CreateRoomDialog,
|
CreateRoomDialog,
|
||||||
{ defaultPublic },
|
{ defaultPublic, defaultEncrypted },
|
||||||
);
|
);
|
||||||
const [shouldCreate, opts] = await modal.finished;
|
const [shouldCreate, opts] = await modal.finished;
|
||||||
if (shouldCreate) {
|
if (shouldCreate) {
|
||||||
|
@ -301,7 +319,7 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
||||||
null,
|
null,
|
||||||
{ "a": (sub) => <a onClick={() => {
|
{ "a": (sub) => <a onClick={() => {
|
||||||
dialog.close();
|
dialog.close();
|
||||||
this.createNewRoom(true);
|
this.createNewRoom(true, false);
|
||||||
}}> {sub} </a> },
|
}}> {sub} </a> },
|
||||||
)} </p>
|
)} </p>
|
||||||
</div>,
|
</div>,
|
||||||
|
|
|
@ -1433,8 +1433,9 @@
|
||||||
"Roles & Permissions": "Roles & Permissions",
|
"Roles & Permissions": "Roles & Permissions",
|
||||||
"Permissions": "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",
|
"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?",
|
"Are you sure you want to add encryption to this public room?": "Are you sure you want to add encryption to this 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.",
|
"<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?",
|
"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>",
|
"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?",
|
"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