diff --git a/packages/core/src/components/collections/NestedCollection.tsx b/packages/core/src/components/collections/NestedCollection.tsx index 9eca254e1..88ed86490 100644 --- a/packages/core/src/components/collections/NestedCollection.tsx +++ b/packages/core/src/components/collections/NestedCollection.tsx @@ -83,7 +83,8 @@ const TreeNode = ({ return ( <> {sortedData.map(node => { - const leaf = node.children.length <= 1 && !node.children[0]?.isDir && depth > 0; + // const leaf = node.children.length <= 1 && !node.children[0]?.isDir && depth > 0; + const leaf = node.children.length === 0 && depth > 0; if (leaf) { return null; } @@ -93,8 +94,8 @@ const TreeNode = ({ } const title = getNodeTitle(node); - const hasChildren = depth === 0 || node.children.some(c => c.children.some(c => c.isDir)); - + // const hasChildren = depth === 0 || node.children.some(c => c.children.some(c => c.isDir)); + const hasChildren = depth === 0 || node.children.some(c => c.isDir); return (
{ - const entryPath = e.path.slice(collectionFolder.length + 1); + let entryPath = e.path.slice(collectionFolder.length + 1); if (!entryPath.startsWith(path)) { return false; } // only show immediate children if (path) { - // non root path - const trimmed = entryPath.slice(path.length + 1); - return trimmed.split('/').length === 2; - } else { - // root path - return entryPath.split('/').length <= 2; + // // non root path + // const trimmed = entryPath.slice(path.length + 1); + // return trimmed.split('/').length === 2; + // } else { + // // root path + // return entryPath.split('/').length <= 2; + entryPath = entryPath.slice(path.length + 1); } + return !entryPath.includes('/'); }); return filtered; }