From 8ae3007cf49c9c5e7526012bc2ccc3fe6ba7968f Mon Sep 17 00:00:00 2001 From: tehcneko Date: Wed, 23 Apr 2025 13:56:57 +0100 Subject: [PATCH] WebUI: Fix collapsing folders with expanded folders inside --- src/webui/www/private/scripts/dynamicTable.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js index 174dc8296..6a916ca6d 100644 --- a/src/webui/www/private/scripts/dynamicTable.js +++ b/src/webui/www/private/scripts/dynamicTable.js @@ -2658,8 +2658,18 @@ window.qBittorrent.DynamicTable ??= (() => { this._updateNodeCollapseIcon(node, shouldCollapse); - for (const child of node.children) - this._updateNodeVisibility(child, shouldCollapse); + this._updateNodeChildVisibility(node, shouldCollapse); + }, + + _updateNodeChildVisibility: function(root, shouldHide) { + const stack = [...root.children]; + while (stack.length > 0) { + const node = stack.pop(); + + this._updateNodeVisibility(node, (shouldHide ? shouldHide : this.isCollapsed(node.root.rowId))); + + stack.push(...node.children); + } }, clear: function() {