Fixed bug where key reset didn't always return the right key

This commit is contained in:
Zoe 2020-02-11 15:56:32 +00:00
parent 7a026eb15d
commit 5382a52519
3 changed files with 18 additions and 10 deletions

View file

@ -225,13 +225,21 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
const { force } = this.props;
try {
await cli.bootstrapSecretStorage({
setupNewSecretStorage: force,
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
createSecretStorageKey: async () => this._keyInfo,
keyBackupInfo: this.state.backupInfo,
setupNewKeyBackup: force || !this.state.backupInfo && this.state.useKeyBackup,
});
if (!force) {
await cli.bootstrapSecretStorage({
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
createSecretStorageKey: async () => this._keyInfo,
keyBackupInfo: this.state.backupInfo,
setupNewKeyBackup: !this.state.backupInfo && this.state.useKeyBackup,
});
} else {
await cli.bootstrapSecretStorage({
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
createSecretStorageKey: async () => this._keyInfo,
setupNewKeyBackup: true,
setupNewSecretStorage: true,
});
}
this.setState({
phase: PHASE_DONE,
});