From 26e0b4390b9c680ce01828791e424cfddb986c95 Mon Sep 17 00:00:00 2001 From: saberzero1 Date: Thu, 3 Oct 2024 21:52:14 +0200 Subject: [PATCH] Addressed feedback --- quartz/components/Explorer.tsx | 2 +- quartz/components/ExplorerNode.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/quartz/components/Explorer.tsx b/quartz/components/Explorer.tsx index 3c967624b..d5c34dd2a 100644 --- a/quartz/components/Explorer.tsx +++ b/quartz/components/Explorer.tsx @@ -147,7 +147,7 @@ export default ((userOpts?: Partial) => { -
+
  • diff --git a/quartz/components/ExplorerNode.tsx b/quartz/components/ExplorerNode.tsx index 88246e049..9b3080fc1 100644 --- a/quartz/components/ExplorerNode.tsx +++ b/quartz/components/ExplorerNode.tsx @@ -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))