Skip to content

Commit e9efabd

Browse files
committed
FE: mixed case on MACs broke node expansion/collapse
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
1 parent eb0f705 commit e9efabd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

front/network.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,10 @@ function getChildren(node, list, path, visited = [])
570570
// Loop through all items to find children of the current node
571571
for (var i in list) {
572572
const item = list[i];
573-
const parentMac = item.devParentMAC || ""; // null-safe
574-
const nodeMac = node.devMac || ""; // null-safe
573+
const parentMac = item.devParentMAC.toLowerCase() || ""; // null-safe
574+
const nodeMac = node.devMac.toLowerCase() || ""; // null-safe
575575

576-
if (parentMac != "" && parentMac.toLowerCase() == nodeMac.toLowerCase() && !hiddenMacs.includes(parentMac)) {
576+
if (parentMac != "" && parentMac == nodeMac && !hiddenMacs.includes(parentMac)) {
577577

578578
visibleNodesCount++;
579579

@@ -654,6 +654,8 @@ function toggleSubTree(parentMac, treePath)
654654
{
655655
treePath = treePath.split('|')
656656

657+
parentMac = parentMac.toLowerCase()
658+
657659
if(!hiddenMacs.includes(parentMac))
658660
{
659661
hiddenMacs.push(parentMac)

0 commit comments

Comments
 (0)