fixed front-end stats undefined bug
This commit is contained in:
parent
13680815f1
commit
e9618aac5c
@ -124,9 +124,12 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
data.stats.hashrate = 0;
|
data.stats.hashrate = 0;
|
||||||
|
|
||||||
var index = findIndex({id: data.id});
|
var index = findIndex({id: data.id});
|
||||||
$scope.nodes[index].stats = data.stats;
|
|
||||||
$scope.nodes[index].history = data.history;
|
if(typeof $scope.nodes[index].stats !== 'undefined') {
|
||||||
makePeerPropagationChart($scope.nodes[index]);
|
$scope.nodes[index].stats = data.stats;
|
||||||
|
$scope.nodes[index].history = data.history;
|
||||||
|
makePeerPropagationChart($scope.nodes[index]);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -174,7 +177,10 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "latency":
|
case "latency":
|
||||||
$scope.nodes[findIndex({id: data.id})].stats.latency = data.latency;
|
var node = $scope.nodes[findIndex({id: data.id})];
|
||||||
|
|
||||||
|
if(typeof node.stats !== 'undefined' && typeof node.stats.latency !== 'undefined')
|
||||||
|
$scope.nodes[findIndex({id: data.id})].stats.latency = data.latency;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user