From 6aab7aec7dde745a41d85ee3888ad15b78f7780c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= Date: Sat, 20 Feb 2016 02:44:49 +0100 Subject: [PATCH] main: fix meshlinks counter --- lib/main.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/main.js b/lib/main.js index a6972eb..e12cd92 100644 --- a/lib/main.js +++ b/lib/main.js @@ -102,10 +102,8 @@ function (moment, Router, L, GUI, numeral) { links.forEach( function (d) { d.source.node.neighbours.push({ node: d.target.node, link: d, incoming: false }) d.target.node.neighbours.push({ node: d.source.node, link: d, incoming: true }) - if (!d.type === "tunnel") { + if (d.type !== "tunnel") d.source.node.meshlinks = d.source.node.meshlinks ? d.source.node.meshlinks + 1 : 1 - d.target.node.meshlinks = d.target.node.meshlinks ? d.target.node.meshlinks + 1 : 1 - } if (d.type === "tunnel") d.type = "VPN" else if (d.type === "wireless") @@ -113,7 +111,7 @@ function (moment, Router, L, GUI, numeral) { else if (d.type === "other") d.type = "Kabel" else - d.type = "NaN" + d.type = "N/A" }) links.sort( function (a, b) {