We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ff90e84 + 38fa72a commit 3e73608Copy full SHA for 3e73608
quartz/quartz/components/ExplorerNode.tsx
@@ -126,13 +126,15 @@ export class FileNode {
126
* @param collapsed default state of folders (collapsed by default or not)
127
* @returns array containing folder state for tree
128
*/
129
- getFolderPaths(collapsed: boolean): FolderState[] {
+ getFolderPaths(collapseSubFolders: boolean): FolderState[] {
130
const folderPaths: FolderState[] = []
131
132
const traverse = (node: FileNode, currentPath: string) => {
133
if (!node.file) {
134
const folderPath = joinSegments(currentPath, node.name)
135
if (folderPath !== "") {
136
+ // If the folder is at the top level, open it by default
137
+ const collapsed = node.depth === 1 ? false : collapseSubFolders
138
folderPaths.push({ path: folderPath, collapsed })
139
}
140
0 commit comments