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 <noreply@anthropic.com>
This commit is contained in:
mjkerrison 2026-01-08 12:35:49 +11:00
parent 47c6490ba9
commit 88cb9541f0
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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);