Fix: modal choose wallet. Sell in Coinbase and Glidera. Spinner

This commit is contained in:
Gustavo Maximiliano Cortez 2016-06-16 18:29:56 -03:00
commit f08f30240a
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
13 changed files with 123 additions and 81 deletions

View file

@ -2,25 +2,24 @@
angular.module('copayApp.controllers').controller('walletsController', function($scope, bwsError, profileService) {
var self = $scope.self;
$scope.selectWallet = function(walletId, walletName) {
if (!profileService.getClient(walletId).isComplete()) {
self.error = bwsError.msg({
'code': 'WALLET_NOT_COMPLETE'
}, 'Could not choose the wallet');
self.error = {
errors: [{
message: 'The Wallet could not be selected'
}]
};
$scope.cancel();
return;
}
self.selectedWalletId = walletId;
self.selectedWalletName = walletName;
self.fc = profileService.getClient(self.selectedWalletId);
$scope.cancel();
var client = profileService.getClient(walletId);
$scope.errorSelectedWallet = {};
profileService.isReady(client, function(err) {
if (err) {
$scope.errorSelectedWallet[walletId] = bwsError.msg(err);
return;
}
var obj = {
'walletId': walletId,
'walletName': walletName,
'client': profileService.getClient(walletId)
}
$scope.$emit('walletSelected', obj);
});
};
$scope.cancel = function() {