From 19e9e0137c027cbf1766b1fed4d8c7471be27d61 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 4 Sep 2020 13:05:30 +0100 Subject: [PATCH] Reorganise backup panel so feature description is always present This ensure the feature description is always shown at the top. --- .../views/settings/SecureBackupPanel.js | 77 ++++++++++--------- src/i18n/strings/en_EN.json | 3 +- 2 files changed, 43 insertions(+), 37 deletions(-) diff --git a/src/components/views/settings/SecureBackupPanel.js b/src/components/views/settings/SecureBackupPanel.js index 684818aa1d..ec345f6317 100644 --- a/src/components/views/settings/SecureBackupPanel.js +++ b/src/components/views/settings/SecureBackupPanel.js @@ -165,31 +165,30 @@ export default class SecureBackupPanel extends React.PureComponent { render() { const Spinner = sdk.getComponent("elements.Spinner"); const AccessibleButton = sdk.getComponent("elements.AccessibleButton"); - const encryptedMessageAreEncrypted = _t( - "Encrypted messages are secured with end-to-end encryption. " + - "Only you and the recipient(s) have the keys to read these messages.", + const featureDescription = _t( + "Back up your encryption keys with your account data in case you " + + "lose access to your sessions. Your keys will be secured with a " + + "unique Recovery Key.", ); + let statusDescription; + let details; + let actions; if (this.state.error) { - return ( + statusDescription = (
{_t("Unable to load key backup status")}
); } else if (this.state.loading) { - return ; + statusDescription = ; } else if (this.state.backupInfo) { - let clientBackupStatus; let restoreButtonCaption = _t("Restore from Backup"); if (MatrixClientPeg.get().getKeyBackupEnabled()) { - clientBackupStatus =
-

{encryptedMessageAreEncrypted}

-

✅ {_t("This session is backing up your keys. ")}

-
; + statusDescription =

✅ {_t("This session is backing up your keys. ")}

; } else { - clientBackupStatus =
-

{encryptedMessageAreEncrypted}

+ statusDescription = <>

{_t( "This session is not backing up your keys, " + "but you do have an existing backup you can restore from " + @@ -200,7 +199,7 @@ export default class SecureBackupPanel extends React.PureComponent { "Connect this session to key backup before signing out to avoid " + "losing any keys that may only be on this session.", )}

-
; + ; restoreButtonCaption = _t("Connect this session to Key Backup"); } @@ -323,17 +322,7 @@ export default class SecureBackupPanel extends React.PureComponent { ; } - const buttonRow = ( -
- - {restoreButtonCaption} -     - {deleteBackupButton} -
- ); - - return
-
{clientBackupStatus}
+ details = (
{_t("Advanced")}
{_t("Backup version: ")}{this.state.backupInfo.version}
@@ -343,24 +332,40 @@ export default class SecureBackupPanel extends React.PureComponent {
{backupSigStatuses}
{trustedLocally}
- {buttonRow} -
; - } else { - return
-
-

{_t( - "Your keys are not being backed up from this session.", {}, - {b: sub => {sub}}, - )}

-

{encryptedMessageAreEncrypted}

-

{_t("Back up your keys before signing out to avoid losing them.")}

+ ); + + actions = ( +
+ + {restoreButtonCaption} +     + {deleteBackupButton}
+ ); + } else { + statusDescription = <> +

{_t( + "Your keys are not being backed up from this session.", {}, + {b: sub => {sub}}, + )}

+

{_t("Back up your keys before signing out to avoid losing them.")}

+ ; + actions = (
{_t("Start using Key Backup")}
-
; + ); } + + return ( +
+

{featureDescription}

+ {statusDescription} + {details} + {actions} +
+ ); } } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 464edba6ce..843373ad07 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -730,7 +730,7 @@ "Save": "Save", "Delete Backup": "Delete Backup", "Are you sure? You will lose your encrypted messages if your keys are not backed up properly.": "Are you sure? You will lose your encrypted messages if your keys are not backed up properly.", - "Encrypted messages are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.": "Encrypted messages are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.", + "Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Recovery Key.": "Back up your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Recovery Key.", "Unable to load key backup status": "Unable to load key backup status", "Restore from Backup": "Restore from Backup", "This session is backing up your keys. ": "This session is backing up your keys. ", @@ -1732,6 +1732,7 @@ "Clear cache and resync": "Clear cache and resync", "%(brand)s now uses 3-5x less memory, by only loading information about other users when needed. Please wait whilst we resynchronise with the server!": "%(brand)s now uses 3-5x less memory, by only loading information about other users when needed. Please wait whilst we resynchronise with the server!", "Updating %(brand)s": "Updating %(brand)s", + "Encrypted messages are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.": "Encrypted messages are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.", "I don't want my encrypted messages": "I don't want my encrypted messages", "Manually export keys": "Manually export keys", "You'll lose access to your encrypted messages": "You'll lose access to your encrypted messages",