diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index fed223c4e..4409eb698 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -111,7 +111,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( var updateHasFunds = function() { - $scope.hasFunds = null; + $scope.hasFunds = true; var wallets = profileService.getWallets({ onlyComplete: true, @@ -125,6 +125,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } var index = 0; + var walletsTotalBalance = 0; lodash.each(wallets, function(w) { walletService.getStatus(w, {}, function(err, status) { ++index; @@ -132,12 +133,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $log.error(err); return; } - - if (status.availableBalanceSat) { - $scope.hasFunds = true; - } - if (index == wallets.length) { - $scope.hasFunds = $scope.hasFunds || false; + walletsTotalBalance = walletsTotalBalance + status.availableBalanceSat; + if (index == wallets.length && walletsTotalBalance == 0) { + $scope.hasFunds = false; $timeout(function() { $scope.$apply(); });