From 404eeac1e8868320f58f163b2f9f1be203c82a48 Mon Sep 17 00:00:00 2001 From: Lost Paul <70213368+LostPaul@users.noreply.github.com> Date: Sat, 3 Feb 2024 19:29:42 +0100 Subject: [PATCH] Hide collapse icon storage location difference --- src/main.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main.ts b/src/main.ts index adc5861..232d0e5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -90,12 +90,6 @@ export default class FolderNotesPlugin extends Plugin { this.tabManager?.updateTabs(); })); - this.registerEvent(this.app.vault.on('delete', (file: TAbstractFile) => { - if (!(file instanceof TFile)) { return; } - const parentFolder = getFolder(this, file); - removeCSSClassFromEL(parentFolder?.path, 'has-folder-note'); - })); - this.registerEvent(this.app.vault.on('create', (file: TAbstractFile) => { handleCreate(file, this); })); @@ -175,12 +169,12 @@ export default class FolderNotesPlugin extends Plugin { } else if (this.settings.ignoreAttachmentFolder && this.app.vault.getAbstractFileByPath(`${folder.path}/${cleanAttachmentFolderPath}`)) { const folderPath = `${folder.path}/${cleanAttachmentFolderPath}` const attachmentFolder = this.app.vault.getAbstractFileByPath(folderPath); - if (attachmentFolder instanceof TFolder) { - if (!folder.collapsed) { + if (attachmentFolder instanceof TFolder && folder.children.length <= threshold + 1) { + if (!folder.collapsed ) { getEl(folder.path)?.click(); } - return folder.children.length <= threshold + 1; } + return folder.children.length <= threshold + 1; } else { return false; } @@ -280,4 +274,5 @@ export default class FolderNotesPlugin extends Plugin { loadFileClasses(true, this); } } + }