fixed arrival updating to NaN
This commit is contained in:
parent
3c7957911c
commit
51ab249429
@ -69,8 +69,12 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "update":
|
case "update":
|
||||||
if(typeof $scope.nodes[findIndex({id: data.id})].stats !== 'undefined' && typeof $scope.nodes[findIndex({id: data.id})].stats.block !== 'undefined' && $scope.nodes[findIndex({id: data.id})].stats.block.number != data.stats.block.number){
|
if(typeof $scope.nodes[findIndex({id: data.id})].stats !== 'undefined' && typeof $scope.nodes[findIndex({id: data.id})].stats.block !== 'undefined'){
|
||||||
data.stats.block.when = (new Date()).getTime() - data.stats.block.arrival;
|
if($scope.nodes[findIndex({id: data.id})].stats.block.number != data.stats.block.number){
|
||||||
|
data.stats.block.when = (new Date()).getTime() - data.stats.block.arrival;
|
||||||
|
} else {
|
||||||
|
data.stats.block.when = $scope.nodes[findIndex({id: data.id})].stats.block.when;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$scope.nodes[findIndex({id: data.id})].stats = data.stats;
|
$scope.nodes[findIndex({id: data.id})].stats = data.stats;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user