fix: show import error sooner
This commit is contained in:
@@ -346,6 +346,12 @@ class AccountMenuCtrl extends PureCtrl {
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const version = data?.auth_params?.version || data?.keyParams?.version;
|
||||||
|
if (!protocolManager.supportedVersions().includes(version)) {
|
||||||
|
this.setState({ importData: null });
|
||||||
|
this.alertManager.alert({ text: STRING_IMPORT_FAILED_NEWER_BACKUP });
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (data.auth_params) {
|
if (data.auth_params) {
|
||||||
await this.setState({
|
await this.setState({
|
||||||
importData: {
|
importData: {
|
||||||
@@ -378,15 +384,6 @@ class AccountMenuCtrl extends PureCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async performImport(data, password) {
|
async performImport(data, password) {
|
||||||
if (
|
|
||||||
data.keyParams ||
|
|
||||||
(data.auth_params && Number(data.auth_params.version) > protocolManager.version())
|
|
||||||
) {
|
|
||||||
this.setState({ importData: null });
|
|
||||||
this.alertManager.alert({ text: STRING_IMPORT_FAILED_NEWER_BACKUP });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.setState({
|
await this.setState({
|
||||||
importData: {
|
importData: {
|
||||||
...this.state.importData,
|
...this.state.importData,
|
||||||
|
|||||||
Reference in New Issue
Block a user