From af41deb0e44277ba7b40196b0a553e51c43a88d4 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Mon, 6 Jul 2015 10:40:40 -0300 Subject: [PATCH] fix tx history refresh --- src/js/controllers/index.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index dd742aba4..97d755bfd 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -279,6 +279,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r return w.id != self.walletId; });; $rootScope.$apply(); + + if (opts.triggerTxUpdate) { + $timeout(function() { + self.updateTxHistory(); + }, 1); + } }); }); }; @@ -771,10 +777,11 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); $rootScope.$on('NewIncomingTx', function() { - self.updateBalance(); - $timeout(function() { - self.updateTxHistory(); - }, 5000); + self.updateAll({ + walletStatus: null, + untilItChanges: true, + triggerTxUpdate: true, + }); }); $rootScope.$on('NewOutgoingTx', function() { @@ -790,11 +797,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r $rootScope.$on(eventName, function(event, untilItChanges) { self.updateAll({ walletStatus: null, - untilItChanges: untilItChanges + untilItChanges: untilItChanges, + triggerTxUpdate: true, }); - $timeout(function() { - self.updateTxHistory(); - }, 3000); }); });