From 8bcb33227676148dec2c1e2dca079ee3ecfa1001 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 23 Aug 2016 10:26:47 -0300 Subject: [PATCH] . --- src/js/controllers/tab-home.js | 5 +---- src/js/services/profileService.js | 5 +++-- src/js/services/walletService.js | 14 +++++++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js index fe9ef3871..eefe6259f 100644 --- a/src/js/controllers/tab-home.js +++ b/src/js/controllers/tab-home.js @@ -105,23 +105,20 @@ angular.module('copayApp.controllers').controller('tabHomeController', $log.debug('Updating wallet:'+ wallet.name) walletService.getStatus(wallet, {}, function(err, status) { -console.log('[tab-home.js.107:status:]',status); //TODO if (err) { console.log('[tab-home.js.35:err:]', $log.error(err)); //TODO return; } if (status.pendingTxps && status.pendingTxps[0]) { - -console.log('[tab-home.js.113]', status.pendingTxps); //TODO var txps = lodash.filter($scope.txps, function(x) { return x.walletId != wallet.id; }); txps = txps.concat(status.pendingTxps); txps = formatPendingTxps(txps); -console.log('[tab-home.js.120:txps:]',txps); //TODO setPendingTxps(txps); } wallet.status = status; + $scope.$apply(); }); }; diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 4886094c4..f8f35c455 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -71,8 +71,9 @@ angular.module('copayApp.services') walletId, wallet.credentials.walletName); - if (wallet.cacheStatus) - wallet.cacheStatus.isValid = false; + // TODO (put this in wallet ViewModel) + if (wallet.cachedStatus) + wallet.cachedStatus.isValid = false; if (wallet.completeHistory) wallet.completeHistory.isValid = false; diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index ca90a9e81..850ca46bd 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -114,12 +114,12 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim root.invalidateCache = function(wallet) { - if (wallet.cacheStatus) { - wallet.cacheStatus.isValid = false; + if (wallet.cachedStatus) { + wallet.cachedStatus.isValid = false; } - if (wallet.cacheHistory) { - wallet.cacheHistory.isValid = false; + if (wallet.completeHistory) { + wallet.completeHistory.isValid = false; } }; @@ -214,7 +214,11 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim }; function _getStatus(initStatusHash, tries, cb) { - if (isStatusCached() && !opts.force) return cb(null, wallet.cachedStatus); + if (isStatusCached() && !opts.force) { + $log.debug('Wallet status cache hit:' + wallet.id); + + return cb(null, wallet.cachedStatus); + }; tries = tries || 0;