From 0e3e62fee8c0163829ec1ca7dfb49bcc78021c6b Mon Sep 17 00:00:00 2001 From: nymkappa Date: Thu, 18 Aug 2022 17:15:05 +0200 Subject: [PATCH] Fix missing isp ids on isp pie chart --- backend/src/api/explorer/nodes.api.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/api/explorer/nodes.api.ts b/backend/src/api/explorer/nodes.api.ts index e59770d50..dd426e8fb 100644 --- a/backend/src/api/explorer/nodes.api.ts +++ b/backend/src/api/explorer/nodes.api.ts @@ -195,19 +195,24 @@ class NodesApi { if (!ispList[isp1]) { ispList[isp1] = { - id: channel.isp1ID, + id: channel.isp1ID.toString(), capacity: 0, channels: 0, nodes: {}, }; + } else if (ispList[isp1].id.indexOf(channel.isp1ID) === -1) { + ispList[isp1].id += ',' + channel.isp1ID.toString(); } + if (!ispList[isp2]) { ispList[isp2] = { - id: channel.isp2ID, + id: channel.isp2ID.toString(), capacity: 0, channels: 0, nodes: {}, }; + } else if (ispList[isp2].id.indexOf(channel.isp2ID) === -1) { + ispList[isp2].id += ',' + channel.isp2ID.toString(); } ispList[isp1].capacity += channel.capacity;