From 1705a752ec1074a4eba5964fee4e46311a0c5008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 14 Oct 2016 11:37:54 -0300 Subject: [PATCH] fix send tip --- src/js/controllers/tab-send.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index 55e64b115..d135cebcf 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -110,7 +110,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( var updateHasFunds = function() { - $scope.hasFunds = null; + $scope.hasFunds = true; var wallets = profileService.getWallets({ onlyComplete: true, @@ -124,6 +124,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; @@ -131,12 +132,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(); });