fix: do not prompt for password with encrypted backup

This commit is contained in:
Baptiste Grob
2020-09-17 15:16:58 +02:00
parent b6dace049c
commit 2cbff5982a

View File

@@ -394,11 +394,12 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
alertDialog({ text: STRING_UNSUPPORTED_BACKUP_FILE_VERSION }); alertDialog({ text: STRING_UNSUPPORTED_BACKUP_FILE_VERSION });
return; return;
} }
if (data.keyParams || data.auth_params) {
await this.setState({ await this.setState({
importData: { importData: {
...this.getState().importData, ...this.getState().importData,
requestPassword: true, requestPassword: true,
data: data data,
} }
}); });
const element = document.getElementById( const element = document.getElementById(
@@ -410,6 +411,9 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
} else { } else {
await this.performImport(data, undefined); await this.performImport(data, undefined);
} }
} else {
await this.performImport(data, undefined);
}
}; };
const needsPrivilege = await this.application!.privilegesService!.actionRequiresPrivilege( const needsPrivilege = await this.application!.privilegesService!.actionRequiresPrivilege(
ProtectedAction.ManageBackups ProtectedAction.ManageBackups