Addressed feedback

This commit is contained in:
saberzero1 2024-10-03 21:52:14 +02:00
parent 835f6a0d61
commit 26e0b4390b
No known key found for this signature in database
GPG Key ID: 41AEE99107640F10
2 changed files with 5 additions and 2 deletions

View File

@ -147,7 +147,7 @@ export default ((userOpts?: Partial<Options>) => {
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<div id="explorer-content" class="">
<div id="explorer-content">
<ul class="overflow" id="explorer-ul">
<ExplorerNode node={fileTree} opts={opts} fileData={fileData} />
<li id="explorer-end" />

View File

@ -134,8 +134,11 @@ export class FileNode {
const traverse = (node: FileNode, currentPath: string) => {
if (!node.file) {
const folderPath = joinSegments(currentPath, node.name)
const collapseState = !currentFile.includes(
folderPath.replace("'", "-").replaceAll("../", ""),
)
if (folderPath !== "") {
folderPaths.push({ path: folderPath, collapsed })
folderPaths.push({ path: folderPath, collapsed: collapseState || collapsed })
}
node.children.forEach((child) => traverse(child, folderPath))