commit
0ca1bf36d2
1 changed files with 5 additions and 7 deletions
|
|
@ -111,7 +111,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,
|
||||||
|
|
@ -125,6 +125,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
}
|
}
|
||||||
|
|
||||||
var index = 0;
|
var index = 0;
|
||||||
|
var walletsTotalBalance = 0;
|
||||||
lodash.each(wallets, function(w) {
|
lodash.each(wallets, function(w) {
|
||||||
walletService.getStatus(w, {}, function(err, status) {
|
walletService.getStatus(w, {}, function(err, status) {
|
||||||
++index;
|
++index;
|
||||||
|
|
@ -132,12 +133,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
$log.error(err);
|
$log.error(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
walletsTotalBalance = walletsTotalBalance + status.availableBalanceSat;
|
||||||
if (status.availableBalanceSat) {
|
if (index == wallets.length && walletsTotalBalance == 0) {
|
||||||
$scope.hasFunds = true;
|
$scope.hasFunds = false;
|
||||||
}
|
|
||||||
if (index == wallets.length) {
|
|
||||||
$scope.hasFunds = $scope.hasFunds || false;
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue