diff --git a/public/views/includes/topbar.html b/public/views/includes/topbar.html index bbda0916c..1a7f28d40 100644 --- a/public/views/includes/topbar.html +++ b/public/views/includes/topbar.html @@ -1,5 +1,5 @@ - + ng-click="topbar.goHome(); index.setCompactTxHistory(); closeToHome = null"> {{'Close'|translate}} - + diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index fe11cace7..87a564471 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -996,6 +996,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); }; + self.setCompactTxHistory = function() { + self.txHistory = self.completeHistory.slice(0, self.historyShowLimit); + if (self.completeHistory.length > self.historyShowLimit) + self.historyShowShowAll = true; + }; + self.debounceUpdateHistory = lodash.debounce(function() { self.updateHistory(); }, 1000); @@ -1178,15 +1184,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r }); }; - $rootScope.$on('Local/UpdateTxHistory', function(event) { - $timeout(function () { - self.txHistory = self.completeHistory.slice(0, self.historyShowLimit); - if (self.completeHistory.length > self.historyShowLimit) - self.historyShowShowAll = true; - }, 10); - }); - - $rootScope.$on('$stateChangeSuccess', function(ev, to, toParams, from, fromParams) { self.prevState = from.name || 'walletHome'; self.tab = 'walletHome'; diff --git a/src/js/controllers/topbar.js b/src/js/controllers/topbar.js index c25102f46..b3f58ad0e 100644 --- a/src/js/controllers/topbar.js +++ b/src/js/controllers/topbar.js @@ -1,14 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('topbarController', function(go, $rootScope) { +angular.module('copayApp.controllers').controller('topbarController', function(go) { this.goHome = function() { - $rootScope.$emit('Local/UpdateTxHistory'); go.walletHome(); }; this.goPreferences = function() { - $rootScope.$emit('Local/UpdateTxHistory'); go.preferences(); };