mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
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:
parent
47c6490ba9
commit
88cb9541f0
2 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue