Address review comments

This commit is contained in:
wz 2025-04-05 10:56:24 +02:00
parent a05835d66e
commit d9df9ec22b
3 changed files with 4 additions and 16 deletions

View file

@ -1,4 +1,4 @@
# Obsidian Folder Navigator
# Folder Navigator
[![GitHub release (Latest by date)](https://img.shields.io/github/v/release/wenlzhang/obsidian-folder-navigator)](https://github.com/wenlzhang/obsidian-folder-navigator/releases) ![GitHub all releases](https://img.shields.io/github/downloads/wenlzhang/obsidian-folder-navigator/total?color=success)

View file

@ -2,7 +2,7 @@
"id": "folder-navigator",
"name": "Folder Navigator",
"version": "0.1.0",
"minAppVersion": "1.0.0",
"minAppVersion": "1.5.3",
"description": "Quickly navigate to folders in your vault using fuzzy search.",
"author": "wenlzhang",
"authorUrl": "https://github.com/wenlzhang",

View file

@ -30,20 +30,8 @@ export class FolderSuggestModal extends FuzzySuggestModal<TFolder> {
}
private getAllFolders(): TFolder[] {
const folders: TFolder[] = [];
const rootFolder = this.app.vault.getRoot();
const collectFolders = (folder: TFolder) => {
folders.push(folder);
folder.children.forEach((child) => {
if (child instanceof TFolder) {
collectFolders(child);
}
});
};
collectFolders(rootFolder);
return folders;
// Use the official Vault.getAllFolders() API instead of custom implementation
return this.app.vault.getAllFolders();
}
getItems(): TFolder[] {