mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Fix #306
This commit is contained in:
parent
347c409619
commit
3daea7efd3
2 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue