From ef209b9aff17916a273048950a0e828954f223e1 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Fri, 19 May 2017 17:53:28 +0200
Subject: [PATCH] [fix] keep filter on issuer - see #457

---
 .../graph/js/controllers/blockchain-controllers.js        | 8 +++++---
 www/plugins/graph/js/controllers/network-controllers.js   | 4 ++--
 www/plugins/graph/templates/network/view_peer_stats.html  | 1 -
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/www/plugins/graph/js/controllers/blockchain-controllers.js b/www/plugins/graph/js/controllers/blockchain-controllers.js
index 4079f7b59..cc8735230 100644
--- a/www/plugins/graph/js/controllers/blockchain-controllers.js
+++ b/www/plugins/graph/js/controllers/blockchain-controllers.js
@@ -268,9 +268,11 @@ function GpBlockchainTxCountController($scope, $q, $state, $filter, $translate,
     if (!item) return
     var from = $scope.times[item._index];
     var to = moment.unix(from).utc().add(1, $scope.txOptions.rangeDuration).unix();
-    $state.go('app.blockchain_search', {
-      q: '_exists_:transactions AND medianTime:>={0} AND medianTime:<{1}'.format(from, to)
-    });
+    var query = '_exists_:transactions AND medianTime:>={0} AND medianTime:<{1}'.format(from, to);
+    if ($scope.txOptions.issuer) {
+      query += ' AND issuer:' + $scope.txOptions.issuer;
+    }
+    $state.go('app.blockchain_search', {q: query});
   };
 
   $scope.setTxRangeDuration = function(txRangeDuration) {
diff --git a/www/plugins/graph/js/controllers/network-controllers.js b/www/plugins/graph/js/controllers/network-controllers.js
index b481ae061..89e9ff08d 100644
--- a/www/plugins/graph/js/controllers/network-controllers.js
+++ b/www/plugins/graph/js/controllers/network-controllers.js
@@ -115,11 +115,11 @@ function GpPeerViewExtendController($scope, $q, $timeout, PluginService, esSetti
   };
 }
 
-function GpPeerStatsController($scope, $timeout, $controller, csCurrency) {
+function GpPeerStatsController($scope, $controller, csCurrency) {
   'ngInject';
 
   // Initialize the super class and extend it.
-  angular.extend(this, $controller('GpBlockchainTxCountCtrl', {$scope: $scope, parameters: null}));
+  angular.extend(this, $controller('GpBlockchainTxCountCtrl', {$scope: $scope}));
 
   $scope.txOptions = $scope.txOptions || {};
   $scope.node = $scope.node || {};
diff --git a/www/plugins/graph/templates/network/view_peer_stats.html b/www/plugins/graph/templates/network/view_peer_stats.html
index 0b16909c3..dad62d4a8 100644
--- a/www/plugins/graph/templates/network/view_peer_stats.html
+++ b/www/plugins/graph/templates/network/view_peer_stats.html
@@ -19,7 +19,6 @@
 
       <div class="item no-padding-xs"
            ng-include="'plugins/graph/templates/blockchain/graph_tx_count.html'"
-           ng-controller="GpBlockchainTxCountCtrl"
            ng-init="setSize(350, 1000)">
       </div>
 
-- 
GitLab