diff --git a/public/views/confirm.html b/public/views/confirm.html index 835cb1d15..9e434de58 100644 --- a/public/views/confirm.html +++ b/public/views/confirm.html @@ -42,6 +42,7 @@
+ Not available
diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index fcf6d857e..2791eb459 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -92,6 +92,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( }; $scope.init = function() { + $scope.notAvailable = false; $scope.wallet = profileService.getWallets()[0]; if ($stateParams.paypro) { diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index 6c14d1a51..46875e1ba 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -47,6 +47,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi $log.debug('No wallet provided'); return; } + $scope.defaultWallet = wallet; $log.debug('Wallet changed: ' + wallet.name); $scope.setAddress(wallet); }); diff --git a/src/js/directives/directives.js b/src/js/directives/directives.js index 6f12e7abb..38812db2a 100644 --- a/src/js/directives/directives.js +++ b/src/js/directives/directives.js @@ -156,6 +156,7 @@ angular.module('copayApp.directives') scope.content = {}; scope.content.wallets = []; + scope.content.notAvailable = false; var minBalance = attrs.minBalance ? parseInt(attrs.minBalance) : 0; var wallets = profileService.getWallets(opts); var filteredWallets = []; @@ -182,13 +183,16 @@ angular.module('copayApp.directives') if (!lodash.isEmpty(filteredWallets)) { scope.content.wallets = filteredWallets; scope.$emit('Wallet/Changed', scope.content.wallets[0]); + } else { + scope.content.notAvailable = true; + $log.warn('No wallet available to make the payment'); } return; } walletService.getStatus(wallets[index], {}, function(err, status) { if (err) $log.error(err); - if (!status.availableBalanceSat) $log.debug('Balance not available on wallet: ' + wallets[index].name); + if (!status.availableBalanceSat) $log.debug('No balance available in: ' + wallets[index].name); if (status.availableBalanceSat > minBalance) filteredWallets.push(wallets[index]); index++; filterWallet();