Trust on decrypt

Add support for trust-on-decrypt (API change, recognise flag on
isKeyBackupTrusted). Catch rejection on wrong passphrase / recovery
key. Fix remembering whether we are restoring with key or passphrase.

Requires https://github.com/matrix-org/matrix-js-sdk/pull/836
This commit is contained in:
David Baker 2019-02-07 14:39:47 +00:00
parent b7fd1336de
commit f79b777dd4
3 changed files with 38 additions and 31 deletions

View file

@ -250,13 +250,19 @@ export default class KeyBackupPanel extends React.PureComponent {
backupSigStatuses = _t("Backup is not signed by any of your devices");
}
let trustedLocally;
if (this.state.backupSigStatus.trusted_locally) {
trustedLocally = _t("This backup is trusted because it has been restored on this device");
}
return <div>
{_t("Backup version: ")}{this.state.backupInfo.version}<br />
{_t("Algorithm: ")}{this.state.backupInfo.algorithm}<br />
{clientBackupStatus}<br />
{uploadStatus}
<div>{backupSigStatuses}</div><br />
<br />
<div>{backupSigStatuses}</div>
<div>{trustedLocally}</div>
<br /><br />
<AccessibleButton kind="primary" onClick={this._restoreBackup}>
{ _t("Restore backup") }
</AccessibleButton>&nbsp;&nbsp;&nbsp;