Skip to content

Commit 3e73608

Browse files
authored
Merge pull request #19 from pubky/catch-21/expand-top-level
open top level Explore by default
2 parents ff90e84 + 38fa72a commit 3e73608

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

quartz/quartz/components/ExplorerNode.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,15 @@ export class FileNode {
126126
* @param collapsed default state of folders (collapsed by default or not)
127127
* @returns array containing folder state for tree
128128
*/
129-
getFolderPaths(collapsed: boolean): FolderState[] {
129+
getFolderPaths(collapseSubFolders: boolean): FolderState[] {
130130
const folderPaths: FolderState[] = []
131131

132132
const traverse = (node: FileNode, currentPath: string) => {
133133
if (!node.file) {
134134
const folderPath = joinSegments(currentPath, node.name)
135135
if (folderPath !== "") {
136+
// If the folder is at the top level, open it by default
137+
const collapsed = node.depth === 1 ? false : collapseSubFolders
136138
folderPaths.push({ path: folderPath, collapsed })
137139
}
138140

0 commit comments

Comments
 (0)