diff --git a/src/functions/folderNoteFunctions.ts b/src/functions/folderNoteFunctions.ts index 012674b..a7d5123 100644 --- a/src/functions/folderNoteFunctions.ts +++ b/src/functions/folderNoteFunctions.ts @@ -27,6 +27,8 @@ import { removeCSSClassFromFileExplorerEL, removeActiveFolder, setActiveFolder, + updateCSSClassesForFolder, + updateCSSClassesForFolderNote, } from 'src/functions/styleFunctions'; import { getFolderNameFromPathString, @@ -491,6 +493,7 @@ export function detachFolderNote(plugin: FolderNotesPlugin, file: TFile): void { undefined, plugin, ); + excludedFolder.showFolderNote = true; excludedFolder.hideInSettings = true; excludedFolder.disableFolderNote = true; excludedFolder.disableSync = true; @@ -499,6 +502,7 @@ export function detachFolderNote(plugin: FolderNotesPlugin, file: TFile): void { excludedFolder.detached = true; excludedFolder.detachedFilePath = file.path; addExcludedFolder(plugin, excludedFolder); + updateCSSClassesForFolderNote(file.path, plugin); } diff --git a/src/functions/styleFunctions.ts b/src/functions/styleFunctions.ts index 4e99d42..3305e11 100644 --- a/src/functions/styleFunctions.ts +++ b/src/functions/styleFunctions.ts @@ -28,6 +28,7 @@ export function refreshAllFolderStyles(forceReload = false, plugin: FolderNotesP /** * @description Updates the CSS classes for a specific folder in the file explorer. */ +// eslint-disable-next-line complexity export async function updateCSSClassesForFolder( folderPath: string, plugin: FolderNotesPlugin, @@ -45,6 +46,7 @@ export async function updateCSSClassesForFolder( if (!folderNote || detachedFolderNote) { removeCSSClassFromFileExplorerEL(folder?.path, 'has-folder-note', false, plugin); removeCSSClassFromFileExplorerEL(folder?.path, 'only-has-folder-note', true, plugin); + removeCSSClassFromFileExplorerEL(folderNote?.path, 'is-folder-note', false, plugin); return; }