You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
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:
@@ -117,6 +117,11 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
|
||||
backupInfo,
|
||||
backupSigStatus,
|
||||
});
|
||||
|
||||
return {
|
||||
backupInfo,
|
||||
backupSigStatus,
|
||||
};
|
||||
}
|
||||
|
||||
async _queryKeyUploadAuth() {
|
||||
@@ -269,13 +274,13 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
|
||||
const RestoreKeyBackupDialog = sdk.getComponent('dialogs.keybackup.RestoreKeyBackupDialog');
|
||||
const { finished } = Modal.createTrackedDialog(
|
||||
'Restore Backup', '', RestoreKeyBackupDialog, {showSummary: false}, null,
|
||||
/* priority = */ false, /* static = */ true,
|
||||
/* priority = */ false, /* static = */ false,
|
||||
);
|
||||
|
||||
await finished;
|
||||
await this._fetchBackupInfo();
|
||||
const { backupSigStatus } = await this._fetchBackupInfo();
|
||||
if (
|
||||
this.state.backupSigStatus.usable &&
|
||||
backupSigStatus.usable &&
|
||||
this.state.canUploadKeysWithPasswordOnly &&
|
||||
this.state.accountPassword
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user