Use latest backup status directly rather than via state
This uses the latest backup status we just retrieved by returning from the lookup path (instead of using it indirectly via state). This is important because state updates are batched, so we can't rely on the value to be updated immediately like we were. Fixes https://github.com/vector-im/riot-web/issues/12562
This commit is contained in:
parent
b1543c4141
commit
d3c7a7ff1f
1 changed files with 8 additions and 3 deletions
|
@ -117,6 +117,11 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
|
||||||
backupInfo,
|
backupInfo,
|
||||||
backupSigStatus,
|
backupSigStatus,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
backupInfo,
|
||||||
|
backupSigStatus,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async _queryKeyUploadAuth() {
|
async _queryKeyUploadAuth() {
|
||||||
|
@ -269,13 +274,13 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
|
||||||
const RestoreKeyBackupDialog = sdk.getComponent('dialogs.keybackup.RestoreKeyBackupDialog');
|
const RestoreKeyBackupDialog = sdk.getComponent('dialogs.keybackup.RestoreKeyBackupDialog');
|
||||||
const { finished } = Modal.createTrackedDialog(
|
const { finished } = Modal.createTrackedDialog(
|
||||||
'Restore Backup', '', RestoreKeyBackupDialog, {showSummary: false}, null,
|
'Restore Backup', '', RestoreKeyBackupDialog, {showSummary: false}, null,
|
||||||
/* priority = */ false, /* static = */ true,
|
/* priority = */ false, /* static = */ false,
|
||||||
);
|
);
|
||||||
|
|
||||||
await finished;
|
await finished;
|
||||||
await this._fetchBackupInfo();
|
const { backupSigStatus } = await this._fetchBackupInfo();
|
||||||
if (
|
if (
|
||||||
this.state.backupSigStatus.usable &&
|
backupSigStatus.usable &&
|
||||||
this.state.canUploadKeysWithPasswordOnly &&
|
this.state.canUploadKeysWithPasswordOnly &&
|
||||||
this.state.accountPassword
|
this.state.accountPassword
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue