From 2c5da21adb8fa28bbe10e09d0413b161dc7d1e70 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 12 Feb 2019 18:06:36 +0000 Subject: [PATCH] KeyBackupPanel fixes * Separate out the emoji from the translateable string * Put back the delete button if you're not using the backup, otherwise you're stuck unable to use key backup at all if you lost your recovery secret and the device you set it up on. --- .../views/settings/KeyBackupPanel.js | 28 ++++++++----------- src/i18n/strings/en_EN.json | 6 ++-- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/components/views/settings/KeyBackupPanel.js b/src/components/views/settings/KeyBackupPanel.js index a2de6d6519..0f0ec997be 100644 --- a/src/components/views/settings/KeyBackupPanel.js +++ b/src/components/views/settings/KeyBackupPanel.js @@ -149,22 +149,15 @@ export default class KeyBackupPanel extends React.PureComponent { } else if (this.state.loading) { return ; } else if (this.state.backupInfo) { + const EmojiText = sdk.getComponent('elements.EmojiText'); let clientBackupStatus; - let buttons; + let restoreButtonCaption = _t("Restore from Backup"); if (MatrixClientPeg.get().getKeyBackupEnabled()) { clientBackupStatus =

{encryptedMessageAreEncrypted}

-

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

+

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

; - buttons =

- - { _t("Restore from Backup") } -     - - { _t("Delete Backup") } - -

; } else { clientBackupStatus =

{encryptedMessageAreEncrypted}

@@ -174,11 +167,7 @@ export default class KeyBackupPanel extends React.PureComponent { )}

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

; - buttons =

- - { _t("Use Key Backup") } - -

; + restoreButtonCaption = _t("Use key backup"); } let uploadStatus; @@ -267,7 +256,14 @@ export default class KeyBackupPanel extends React.PureComponent {
{backupSigStatuses}
{trustedLocally}
- {buttons} +

+ + {restoreButtonCaption} +     + + { _t("Delete Backup") } + +

; } else { return
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index a19b8e7cdf..8854019737 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -442,11 +442,11 @@ "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.", "Unable to load key backup status": "Unable to load key backup status", - "This device is backing up your keys. ✅": "This device is backing up your keys. ✅", "Restore from Backup": "Restore from Backup", + "This device is backing up your keys. ": "This device is backing up your keys. ", "This device is not backing up your keys.": "This device is not backing up your keys.", "Back up your keys before signing out to avoid losing them.": "Back up your keys before signing out to avoid losing them.", - "Use Key Backup": "Use Key Backup", + "Use key backup": "Use key backup", "Backing up %(sessionsRemaining)s keys...": "Backing up %(sessionsRemaining)s keys...", "All keys backed up": "All keys backed up", "Backup has a signature from unknown device with ID %(deviceId)s.": "Backup has a signature from unknown device with ID %(deviceId)s.", @@ -787,6 +787,7 @@ "You are trying to access a room.": "You are trying to access a room.", "Click here to join the discussion!": "Click here to join the discussion!", "This is a preview of this room. Room interactions have been disabled": "This is a preview of this room. Room interactions have been disabled", + "Use Key Backup": "Use Key Backup", "Never lose encrypted messages": "Never lose encrypted messages", "Messages in this room are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.": "Messages in this room are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.", "Securely back up your keys to avoid losing them. Learn more.": "Securely back up your keys to avoid losing them. Learn more.", @@ -1173,6 +1174,7 @@ "Failed to decrypt %(failedCount)s sessions!": "Failed to decrypt %(failedCount)s sessions!", "Restored %(sessionCount)s session keys": "Restored %(sessionCount)s session keys", "Enter Recovery Passphrase": "Enter Recovery Passphrase", + "Warning: you should only set up key backup from a trusted computer.": "Warning: you should only set up key backup from a trusted computer.", "Access your secure message history and set up secure messaging by entering your recovery passphrase.": "Access your secure message history and set up secure messaging by entering your recovery passphrase.", "Next": "Next", "If you've forgotten your recovery passphrase you can use your recovery key or set up new recovery options": "If you've forgotten your recovery passphrase you can use your recovery key or set up new recovery options",