From 291380915f8aae6c9b56c8385eed1c1bf242f12d Mon Sep 17 00:00:00 2001 From: lindsay Date: Tue, 15 Oct 2024 21:34:25 +0200 Subject: [PATCH] [FIX] TreeViewPlugin storey spatial sort robustness --- src/plugins/TreeViewPlugin/TreeViewPlugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/TreeViewPlugin/TreeViewPlugin.js b/src/plugins/TreeViewPlugin/TreeViewPlugin.js index 19903b24fe..180e7d0382 100644 --- a/src/plugins/TreeViewPlugin/TreeViewPlugin.js +++ b/src/plugins/TreeViewPlugin/TreeViewPlugin.js @@ -1204,8 +1204,8 @@ export class TreeViewPlugin extends Plugin { if (!children || children.length === 0) { return; } - if (this._hierarchy === "storeys" && node.type === "IfcBuilding") { - // Assumes that children of an IfcBuilding will always be IfcBuildingStoreys + const firstChild = children[0]; + if (this._hierarchy === "storeys" && firstChild.type === "IfcBuildingStorey") { children.sort(this._getSpatialSortFunc()); } else { children.sort(this._alphaSortFunc);