Import profile now checks if profile exists
This commit is contained in:
parent
af6c066c3f
commit
551da51c41
2 changed files with 26 additions and 20 deletions
|
|
@ -28,17 +28,17 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
|
|||
passphraseConfig: config.passphraseConfig,
|
||||
}, function(err, iden) {
|
||||
if (err) {
|
||||
// if (err && !iden) {
|
||||
$scope.loading = false;
|
||||
|
||||
|
||||
if ((err.toString() || '').match('BADSTR')) {
|
||||
$scope.error ='Bad password or corrupt profile file';
|
||||
$scope.error = 'Bad password or corrupt profile file';
|
||||
} else if ((err.toString() || '').match('EEXISTS')) {
|
||||
$scope.error = 'Profile already exists';
|
||||
} else {
|
||||
$scope.error = 'Unknown error';
|
||||
}
|
||||
|
||||
$scope.$digest();
|
||||
|
||||
} else {
|
||||
var firstWallet = iden.getLastFocusedWallet();
|
||||
controllerUtils.bindProfile($scope, iden, firstWallet);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue