Merge pull request #405 from gabrielbazan7/fix/sendTip

fix send tip
This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-12 14:13:38 -03:00 committed by GitHub
commit 038a4f31b7

View file

@ -106,7 +106,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
var updateHasFunds = function() { var updateHasFunds = function() {
$scope.hasFunds = null; $scope.hasFunds = true;
var wallets = profileService.getWallets({ var wallets = profileService.getWallets({
onlyComplete: true, onlyComplete: true,
@ -114,6 +114,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
if (!wallets || !wallets.length) { if (!wallets || !wallets.length) {
$scope.hasFunds = false; $scope.hasFunds = false;
$timeout(function() {
$scope.$apply();
});
} }
var index = 0; var index = 0;
@ -124,13 +127,16 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
$log.error(err); $log.error(err);
return; return;
} }
if (status.availableBalanceSat && status.availableBalanceSat > 0) {
if (status.availableBalanceSat) {
$scope.hasFunds = true; $scope.hasFunds = true;
} }
else $scope.hasFunds = false;
if (index == wallets.length) { if (index == wallets.length) {
$scope.hasFunds = $scope.hasFunds || false; $scope.hasFunds = $scope.hasFunds || false;
} }
$timeout(function() {
$scope.$apply();
})
}); });
}); });
}; };