no flicker
This commit is contained in:
parent
41b8c7f064
commit
f49bc5f24c
1 changed files with 11 additions and 11 deletions
|
|
@ -109,27 +109,26 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var updateHasFunds = function() {
|
var updateHasFunds = function() {
|
||||||
$scope.hasFunds = true;
|
|
||||||
|
|
||||||
if ($rootScope.everHadFunds) {
|
if ($rootScope.everHasFunds) {
|
||||||
|
$scope.hasFunds = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.hasFunds = false;
|
||||||
|
|
||||||
var wallets = profileService.getWallets({
|
var wallets = profileService.getWallets({
|
||||||
onlyComplete: true,
|
onlyComplete: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!wallets || !wallets.length) {
|
if (!wallets || !wallets.length) {
|
||||||
$scope.hasFunds = false;
|
return $timeout(function() {
|
||||||
$timeout(function() {
|
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|
@ -137,12 +136,13 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
$log.error(err);
|
$log.error(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
walletsTotalBalance = walletsTotalBalance + status.availableBalanceSat;
|
|
||||||
if (walletsTotalBalance > 0) {
|
if (status.availableBalanceSat > 0) {
|
||||||
$rootScope.everHadFunds = true;
|
$scope.hasFunds = true;
|
||||||
|
$rootScope.everHasFunds = true;
|
||||||
}
|
}
|
||||||
if (index == wallets.length && walletsTotalBalance == 0) {
|
|
||||||
$scope.hasFunds = false;
|
if (index == wallets.length) {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue