mirror of https://github.com/vector-im/riot-web
Show whether backup key is stored
parent
d2f2d3b344
commit
4417235d9e
|
@ -33,6 +33,8 @@ export default class KeyBackupPanel extends React.PureComponent {
|
||||||
loading: true,
|
loading: true,
|
||||||
error: null,
|
error: null,
|
||||||
backupInfo: null,
|
backupInfo: null,
|
||||||
|
backupSigStatus: null,
|
||||||
|
backupKeyStored: null,
|
||||||
sessionsRemaining: 0,
|
sessionsRemaining: 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -74,9 +76,11 @@ export default class KeyBackupPanel extends React.PureComponent {
|
||||||
async _checkKeyBackupStatus() {
|
async _checkKeyBackupStatus() {
|
||||||
try {
|
try {
|
||||||
const {backupInfo, trustInfo} = await MatrixClientPeg.get().checkKeyBackup();
|
const {backupInfo, trustInfo} = await MatrixClientPeg.get().checkKeyBackup();
|
||||||
|
const backupKeyStored = await MatrixClientPeg.get().isKeyBackupKeyStored();
|
||||||
this.setState({
|
this.setState({
|
||||||
backupInfo,
|
backupInfo,
|
||||||
backupSigStatus: trustInfo,
|
backupSigStatus: trustInfo,
|
||||||
|
backupKeyStored,
|
||||||
error: null,
|
error: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
|
@ -87,6 +91,7 @@ export default class KeyBackupPanel extends React.PureComponent {
|
||||||
error: e,
|
error: e,
|
||||||
backupInfo: null,
|
backupInfo: null,
|
||||||
backupSigStatus: null,
|
backupSigStatus: null,
|
||||||
|
backupKeyStored: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -97,11 +102,13 @@ export default class KeyBackupPanel extends React.PureComponent {
|
||||||
try {
|
try {
|
||||||
const backupInfo = await MatrixClientPeg.get().getKeyBackupVersion();
|
const backupInfo = await MatrixClientPeg.get().getKeyBackupVersion();
|
||||||
const backupSigStatus = await MatrixClientPeg.get().isKeyBackupTrusted(backupInfo);
|
const backupSigStatus = await MatrixClientPeg.get().isKeyBackupTrusted(backupInfo);
|
||||||
|
const backupKeyStored = await MatrixClientPeg.get().isKeyBackupKeyStored();
|
||||||
if (this._unmounted) return;
|
if (this._unmounted) return;
|
||||||
this.setState({
|
this.setState({
|
||||||
error: null,
|
error: null,
|
||||||
backupInfo,
|
backupInfo,
|
||||||
backupSigStatus,
|
backupSigStatus,
|
||||||
|
backupKeyStored,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -111,6 +118,7 @@ export default class KeyBackupPanel extends React.PureComponent {
|
||||||
error: e,
|
error: e,
|
||||||
backupInfo: null,
|
backupInfo: null,
|
||||||
backupSigStatus: null,
|
backupSigStatus: null,
|
||||||
|
backupKeyStored: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -220,6 +228,13 @@ export default class KeyBackupPanel extends React.PureComponent {
|
||||||
restoreButtonCaption = _t("Connect this device to Key Backup");
|
restoreButtonCaption = _t("Connect this device to Key Backup");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let keyStatus;
|
||||||
|
if (this.state.backupKeyStored === true) {
|
||||||
|
keyStatus = _t("in secret storage");
|
||||||
|
} else {
|
||||||
|
keyStatus = _t("not stored");
|
||||||
|
}
|
||||||
|
|
||||||
let uploadStatus;
|
let uploadStatus;
|
||||||
const { sessionsRemaining } = this.state;
|
const { sessionsRemaining } = this.state;
|
||||||
if (!MatrixClientPeg.get().getKeyBackupEnabled()) {
|
if (!MatrixClientPeg.get().getKeyBackupEnabled()) {
|
||||||
|
@ -331,6 +346,7 @@ export default class KeyBackupPanel extends React.PureComponent {
|
||||||
<summary>{_t("Advanced")}</summary>
|
<summary>{_t("Advanced")}</summary>
|
||||||
<div>{_t("Backup version: ")}{this.state.backupInfo.version}</div>
|
<div>{_t("Backup version: ")}{this.state.backupInfo.version}</div>
|
||||||
<div>{_t("Algorithm: ")}{this.state.backupInfo.algorithm}</div>
|
<div>{_t("Algorithm: ")}{this.state.backupInfo.algorithm}</div>
|
||||||
|
<div>{_t("Backup key stored: ")}{keyStatus}</div>
|
||||||
{uploadStatus}
|
{uploadStatus}
|
||||||
<div>{backupSigStatuses}</div>
|
<div>{backupSigStatuses}</div>
|
||||||
<div>{trustedLocally}</div>
|
<div>{trustedLocally}</div>
|
||||||
|
|
|
@ -527,6 +527,7 @@
|
||||||
"This device is <b>not backing up your keys</b>, but you do have an existing backup you can restore from and add to going forward.": "This device is <b>not backing up your keys</b>, but you do have an existing backup you can restore from and add to going forward.",
|
"This device is <b>not backing up your keys</b>, but you do have an existing backup you can restore from and add to going forward.": "This device is <b>not backing up your keys</b>, but you do have an existing backup you can restore from and add to going forward.",
|
||||||
"Connect this device to key backup before signing out to avoid losing any keys that may only be on this device.": "Connect this device to key backup before signing out to avoid losing any keys that may only be on this device.",
|
"Connect this device to key backup before signing out to avoid losing any keys that may only be on this device.": "Connect this device to key backup before signing out to avoid losing any keys that may only be on this device.",
|
||||||
"Connect this device to Key Backup": "Connect this device to Key Backup",
|
"Connect this device to Key Backup": "Connect this device to Key Backup",
|
||||||
|
"not stored": "not stored",
|
||||||
"Backing up %(sessionsRemaining)s keys...": "Backing up %(sessionsRemaining)s keys...",
|
"Backing up %(sessionsRemaining)s keys...": "Backing up %(sessionsRemaining)s keys...",
|
||||||
"All keys backed up": "All keys backed up",
|
"All keys backed up": "All keys backed up",
|
||||||
"Backup has a <validity>valid</validity> signature from this user": "Backup has a <validity>valid</validity> signature from this user",
|
"Backup has a <validity>valid</validity> signature from this user": "Backup has a <validity>valid</validity> signature from this user",
|
||||||
|
@ -543,6 +544,7 @@
|
||||||
"This backup is trusted because it has been restored on this device": "This backup is trusted because it has been restored on this device",
|
"This backup is trusted because it has been restored on this device": "This backup is trusted because it has been restored on this device",
|
||||||
"Backup version: ": "Backup version: ",
|
"Backup version: ": "Backup version: ",
|
||||||
"Algorithm: ": "Algorithm: ",
|
"Algorithm: ": "Algorithm: ",
|
||||||
|
"Backup key stored: ": "Backup key stored: ",
|
||||||
"Start using Key Backup with Secure Secret Storage": "Start using Key Backup with Secure Secret Storage",
|
"Start using Key Backup with Secure Secret Storage": "Start using Key Backup with Secure Secret Storage",
|
||||||
"Your keys are <b>not being backed up from this device</b>.": "Your keys are <b>not being backed up from this device</b>.",
|
"Your keys are <b>not being backed up from this device</b>.": "Your keys are <b>not being backed up from this device</b>.",
|
||||||
"Back up your keys before signing out to avoid losing them.": "Back up your keys before signing out to avoid losing them.",
|
"Back up your keys before signing out to avoid losing them.": "Back up your keys before signing out to avoid losing them.",
|
||||||
|
|
Loading…
Reference in New Issue