returning error when allet already exists in profile

This commit is contained in:
Ivan Socolsky 2014-12-03 19:20:51 -03:00
commit bd0ddf5c8c
3 changed files with 13 additions and 1 deletions

View file

@ -125,11 +125,14 @@ angular.module('copayApp.controllers').controller('JoinController',
privateHex: $scope.private,
}, function(err) {
$scope.loading = false;
console.log(err);
if (err) {
if (err === 'joinError')
notification.error('Fatal error connecting to Insight server');
else if (err === 'walletFull')
notification.error('The wallet is full');
else if (err === 'walletAlreadyExists')
notification.error('Wallet already exists', 'Cannot join again from the same profile');
else if (err === 'badNetwork')
notification.error('Network Error', 'Wallet network configuration missmatch');
else if (err === 'badSecret')
@ -138,6 +141,7 @@ angular.module('copayApp.controllers').controller('JoinController',
notification.error('Error', err.message || err);
}
}
$timeout(function () { $scope.$digest(); }, 1);
});
}
});