From 62e2f73a7aa0f94929cd94f8e35c2fc3df476ada Mon Sep 17 00:00:00 2001 From: cubedro Date: Mon, 6 Apr 2015 07:30:32 +0300 Subject: [PATCH] fixed miners not showing when best block comes from client not updated --- public/js/controllers.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/js/controllers.js b/public/js/controllers.js index 2fa8576..50578ff 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -45,6 +45,10 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { $scope.$apply(); }, 1000); + $scope.getNumber = function(num) { + return new Array(num); + } + // Socket listeners // ---------------- @@ -158,10 +162,9 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { $scope.difficultyChange = $scope.bestStats.difficulty; $scope.transactionDensity = $scope.bestStats.txDensity; $scope.gasSpending = $scope.bestStats.gasSpending; - $scope.miners = $scope.bestStats.miners; - $scope.getNumber = function(num) { - return new Array(num); + if(typeof $scope.bestStats.miners !== 'undefined') { + $scope.miners = $scope.bestStats.miners; } jQuery('.spark-blocktimes').sparkline($scope.lastBlocksTime.reverse(), {type: 'bar', tooltipSuffix: 's'});