add "Cache" for hasFunds
This commit is contained in:
parent
f9fd629734
commit
0fbde71996
1 changed files with 7 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService) {
|
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, $rootScope) {
|
||||||
|
|
||||||
var originalList;
|
var originalList;
|
||||||
var CONTACTS_SHOW_LIMIT;
|
var CONTACTS_SHOW_LIMIT;
|
||||||
|
|
@ -113,6 +113,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
var updateHasFunds = function() {
|
var updateHasFunds = function() {
|
||||||
$scope.hasFunds = true;
|
$scope.hasFunds = true;
|
||||||
|
|
||||||
|
if ($rootScope.everHasFunds)
|
||||||
|
return;
|
||||||
|
|
||||||
var wallets = profileService.getWallets({
|
var wallets = profileService.getWallets({
|
||||||
onlyComplete: true,
|
onlyComplete: true,
|
||||||
});
|
});
|
||||||
|
|
@ -134,6 +137,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
walletsTotalBalance = walletsTotalBalance + status.availableBalanceSat;
|
walletsTotalBalance = walletsTotalBalance + status.availableBalanceSat;
|
||||||
|
if (walletsTotalBalance>0) {
|
||||||
|
$rootScope.everHasFunds = true;
|
||||||
|
}
|
||||||
if (index == wallets.length && walletsTotalBalance == 0) {
|
if (index == wallets.length && walletsTotalBalance == 0) {
|
||||||
$scope.hasFunds = false;
|
$scope.hasFunds = false;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue