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,18 +394,22 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
alertDialog({ text: STRING_UNSUPPORTED_BACKUP_FILE_VERSION }); alertDialog({ text: STRING_UNSUPPORTED_BACKUP_FILE_VERSION });
return; return;
} }
await this.setState({ if (data.keyParams || data.auth_params) {
importData: { await this.setState({
...this.getState().importData, importData: {
requestPassword: true, ...this.getState().importData,
data: data requestPassword: true,
data,
}
});
const element = document.getElementById(
ELEMENT_ID_IMPORT_PASSWORD_INPUT
);
if (element) {
element.scrollIntoView(false);
} }
}); } else {
const element = document.getElementById( await this.performImport(data, undefined);
ELEMENT_ID_IMPORT_PASSWORD_INPUT
);
if (element) {
element.scrollIntoView(false);
} }
} else { } else {
await this.performImport(data, undefined); await this.performImport(data, undefined);