From 708a1568a6c77a1ed586d452bb1e4d0bfa418504 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 30 Sep 2025 16:26:28 -0600 Subject: [PATCH] attempting another fix for the svg cable sorting to prevent cables flipping --- src/bin/BinSVGV2.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/BinSVGV2.tsx b/src/bin/BinSVGV2.tsx index c3c1a40..f3c3454 100644 --- a/src/bin/BinSVGV2.tsx +++ b/src/bin/BinSVGV2.tsx @@ -507,9 +507,9 @@ export default function BinSVGV2(props: Props) { //if the cables have the same number of nodes if (b.temperatures.length === a.temperatures.length) { //sort by temp only last and any type that has humidity first - if ((avg(a.humidities) === 0 || a.humidities.length === 0) && (avg(b.humidities) !== 0 || b.humidities.length > 0)) { + if ((avg(a.humidities) === 0) && (avg(b.humidities) !== 0)) { return 1; - } else if ((avg(b.humidities) === 0 || b.humidities.length === 0) && (avg(a.humidities) !== 0 || a.humidities.length > 0)) { + } else if ((avg(b.humidities) === 0) && (avg(a.humidities) !== 0)) { return -1; } else {