Merge pull request #4701 from matrix-org/bwindels/preventbootstrapfromkeybackuprestore

Prevent (double) 4S bootstrap from RestoreKeyBackupDialog
This commit is contained in:
Bruno Windels 2020-06-04 12:07:19 +00:00 committed by GitHub
commit 77b012e49b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -227,8 +227,10 @@ export default class RestoreKeyBackupDialog extends React.PureComponent {
loadError: null,
});
try {
const backupInfo = await MatrixClientPeg.get().getKeyBackupVersion();
const backupKeyStored = await MatrixClientPeg.get().isKeyBackupKeyStored();
const cli = MatrixClientPeg.get();
const backupInfo = await cli.getKeyBackupVersion();
const has4S = await cli.hasSecretStorageKey();
const backupKeyStored = has4S && await cli.isKeyBackupKeyStored();
this.setState({
backupInfo,
backupKeyStored,