From 32a09dfb7b17cc1b2726471e04567401db15901d Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 9 Dec 2015 11:57:43 -0300 Subject: [PATCH] Notify when history is updating the latest tx sent. After sent, back home --- public/views/walletHome.html | 14 ++++++++++---- src/js/controllers/index.js | 14 +++++++------- src/js/controllers/walletHome.js | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 640486b0d..0bf7f9c24 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -75,7 +75,7 @@
-
+
{{index.updateError|translate}}
@@ -85,7 +85,7 @@
Tap to retry
-
+
{{index.totalBalanceStr}}
@@ -180,7 +180,7 @@ No transactions yet - +

Could not fetch transaction history

@@ -206,7 +206,13 @@
-

Activity

+

+ Activity + + Updating... + +

+
diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index d6d88c512..06c71803d 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -364,7 +364,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r if (opts.triggerTxUpdate) { $timeout(function() { - self.updateTxHistory(); + self.debounceUpdateHistory(); }, 1); } }); @@ -953,13 +953,13 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); }; - self.updateTxHistory = lodash.debounce(function() { + self.debounceUpdateHistory = lodash.debounce(function() { self.updateHistory(); }, 1000); self.throttledUpdateHistory = lodash.throttle(function() { self.updateHistory(); - }, 5000); + }, 10000); self.showErrorPopup = function(msg, cb) { $log.warn('Showing err popup:' + msg); @@ -1140,7 +1140,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r $rootScope.$on('Local/ClearHistory', function(event) { $log.debug('The wallet transaction history has been deleted'); self.txHistory = self.completeHistory = []; - self.updateHistory(); + self.debounceUpdateHistory(); }); $rootScope.$on('Local/AddressbookUpdated', function(event, ab) { @@ -1232,7 +1232,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.updateAll({ quiet: true }); - self.updateTxHistory(); + self.debounceUpdateHistory(); }, 4000, { leading: false, trailing: true @@ -1301,7 +1301,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r if (self.network == 'testnet') { self.throttledUpdateHistory(); } else { - self.updateTxHistory(); + self.debounceUpdateHistory(); } } }); @@ -1362,7 +1362,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r $rootScope.$on('Local/NewFocusedWallet', function() { self.setUxLanguage(); self.setFocusedWallet(); - self.updateTxHistory(); + self.debounceUpdateHistory(); self.isDisclaimerAccepted(); storageService.getCleanAndScanAddresses(function(err, walletId) { if (walletId && profileService.walletClients[walletId]) { diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index a308f6571..831c1cf96 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -911,7 +911,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi $timeout(function() { $scope.$digest(); }, 1); - } + } else go.walletHome(); }); }); });