Don't start key backups when opening settings (#11640)
* SecureBackupPanel: stop calling `checkKeyBackup` `checkKeyBackup` will start key backups if they aren't already running. In my not-so-humble opinion, the mere act of opening a settings panel shouldn't change anything. * fix SecurityUserSettingsTab test
This commit is contained in:
parent
c6fec9b95b
commit
c879882558
5 changed files with 95 additions and 53 deletions
|
@ -67,7 +67,7 @@ export default class SecureBackupPanel extends React.PureComponent<{}, IState> {
|
|||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.checkKeyBackupStatus();
|
||||
this.loadBackupStatus();
|
||||
|
||||
MatrixClientPeg.safeGet().on(CryptoEvent.KeyBackupStatus, this.onKeyBackupStatus);
|
||||
MatrixClientPeg.safeGet().on(CryptoEvent.KeyBackupSessionsRemaining, this.onKeyBackupSessionsRemaining);
|
||||
|
@ -97,28 +97,6 @@ export default class SecureBackupPanel extends React.PureComponent<{}, IState> {
|
|||
this.loadBackupStatus();
|
||||
};
|
||||
|
||||
private async checkKeyBackupStatus(): Promise<void> {
|
||||
this.getUpdatedDiagnostics();
|
||||
try {
|
||||
const keyBackupResult = await MatrixClientPeg.safeGet().checkKeyBackup();
|
||||
this.setState({
|
||||
loading: false,
|
||||
error: false,
|
||||
backupInfo: keyBackupResult?.backupInfo ?? null,
|
||||
backupSigStatus: keyBackupResult?.trustInfo ?? null,
|
||||
});
|
||||
} catch (e) {
|
||||
logger.log("Unable to fetch check backup status", e);
|
||||
if (this.unmounted) return;
|
||||
this.setState({
|
||||
loading: false,
|
||||
error: true,
|
||||
backupInfo: null,
|
||||
backupSigStatus: null,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private async loadBackupStatus(): Promise<void> {
|
||||
this.setState({ loading: true });
|
||||
this.getUpdatedDiagnostics();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue