Merge pull request #5336 from gabrielbazan7/ref/checkBalance

check balance refactor
This commit is contained in:
Javier Donadío 2016-12-23 15:27:25 -03:00 committed by GitHub
commit 58247503a5

View file

@ -133,13 +133,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
lodash.each(wallets, function(w) {
walletService.getStatus(w, {}, function(err, status) {
++index;
if (index == wallets.length) $scope.checkingBalance = false;
if (err || !status) {
if (err && !status) {
$log.error(err);
return;
}
if (status.availableBalanceSat > 0) {
} else if (status.availableBalanceSat > 0) {
$scope.hasFunds = true;
$rootScope.everHasFunds = true;
}
@ -148,6 +144,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
if ($scope.hasFunds != true) {
$ionicScrollDelegate.freezeScroll(true);
}
$scope.checkingBalance = false;
$timeout(function() {
$scope.$apply();
});