Importing errors handled

This commit is contained in:
Gabriel Masclef 2017-11-15 11:36:53 -03:00
parent e07a584816
commit 67d2b83fdf
No known key found for this signature in database
GPG Key ID: DD6D7EAADE12280D
3 changed files with 26 additions and 1 deletions

View File

@ -14,6 +14,21 @@
</ion-segment-button>
</ion-segment>
<ion-card (click)="importErr = false">
<ion-item *ngIf="importErr" class="assertive">
<div translate>Could not access the wallet at the server. Please check:</div>
<ul>
<li translate>The password of the recovery phrase (if set)</li>
<li translate>The derivation path</li>
<li translate>The wallet service URL</li>
</ul>
<small translate>
NOTE: To import a wallet from a 3rd party software, please go to Add Wallet &gt; Create Wallet, and specify the Recovery
Phrase there.
</small>
</ion-item>
</ion-card>
<form [formGroup]="importForm" (ngSubmit)="import()">
<ion-item *ngIf="selectedTab == 'words'">
<ion-label stacked>Type the recovery phrase (usually 12 words)</ion-label>

View File

@ -0,0 +1,8 @@
page-import-wallet {
.assertive {
color: color($colors, danger);
ion-label {
white-space: inherit;
}
}
}

View File

@ -213,12 +213,12 @@ export class ImportWalletPage implements OnInit {
this.onGoingProcessProvider.set('importingWallet', false);
this.finish(wallet);
}).catch((err: any) => {
this.onGoingProcessProvider.set('importingWallet', false);
if (err instanceof this.errors.NOT_AUTHORIZED) {
this.importErr = true;
} else {
this.popupProvider.ionicAlert('Error', err); // TODO: gettextcatalog
}
this.onGoingProcessProvider.set('importingWallet', false);
return;
});
}, 100);
@ -236,6 +236,8 @@ export class ImportWalletPage implements OnInit {
} else {
this.popupProvider.ionicAlert('Error', err); // TODO: gettextcatalog
}
this.onGoingProcessProvider.set('importingWallet', false);
return;
});
}, 100);
}