From 88cb9541f09054a6770bbd76ca38cc3d830f4970 Mon Sep 17 00:00:00 2001 From: mjkerrison <25721638+mjkerrison@users.noreply.github.com> Date: Thu, 8 Jan 2026 12:35:49 +1100 Subject: [PATCH] fix: prevent excluded folders list from being reset The filter logic in deleteFolderNote() and hideFolderNoteInFileExplorer() was using && instead of ||, causing all excluded folders with showFolderNote=false (the default) to be removed instead of just the target entry. Fixes #293 Co-Authored-By: Claude Opus 4.5 --- src/functions/folderNoteFunctions.ts | 2 +- src/functions/styleFunctions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions/folderNoteFunctions.ts b/src/functions/folderNoteFunctions.ts index 69e1830..e91d750 100644 --- a/src/functions/folderNoteFunctions.ts +++ b/src/functions/folderNoteFunctions.ts @@ -410,7 +410,7 @@ export async function deleteFolderNote( if (!folder) return; plugin.settings.excludeFolders = plugin.settings.excludeFolders.filter( - (excludedFolder) => (excludedFolder.path !== folder.path) && excludedFolder.showFolderNote); + (excludedFolder) => (excludedFolder.path !== folder.path) || !excludedFolder.showFolderNote); plugin.saveSettings(false); removeCSSClassFromFileExplorerEL(folder.path, 'has-folder-note', false, plugin); diff --git a/src/functions/styleFunctions.ts b/src/functions/styleFunctions.ts index a99c6b8..7959702 100644 --- a/src/functions/styleFunctions.ts +++ b/src/functions/styleFunctions.ts @@ -226,7 +226,7 @@ export function showFolderNoteInFileExplorer(path: string, plugin: FolderNotesPl export function hideFolderNoteInFileExplorer(folderPath: string, plugin: FolderNotesPlugin): void { plugin.settings.excludeFolders = plugin.settings.excludeFolders.filter( - (folder) => (folder.path !== folderPath) && folder.showFolderNote); + (folder) => (folder.path !== folderPath) || !folder.showFolderNote); plugin.saveSettings(false); removeCSSClassFromFileExplorerEL(folderPath, 'show-folder-note-in-explorer', true, plugin); updateCSSClassesForFolder(folderPath, plugin);