diff --git a/manifest.json b/manifest.json index db3e55c..62074f0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "folder-notes", "name": "Folder notes", - "version": "1.4.4", + "version": "1.4.5", "minAppVersion": "0.15.0", "description": "Create notes within folders that can be accessed without collapsing the folder, similar to the functionality offered in Notion.", "author": "Lost Paul", diff --git a/src/main.ts b/src/main.ts index 9db91b3..b2b89e9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,9 +33,11 @@ export default class FolderNotesPlugin extends Plugin { new Commands(this.app, this).registerCommands(); - if (this.settings.frontMatterTitle.enabled) { - this.fmtpHandler = new FrontMatterTitlePluginHandler(this); - } + this.app.workspace.onLayoutReady(() => { + if (this.settings.frontMatterTitle.enabled) { + this.fmtpHandler = new FrontMatterTitlePluginHandler(this); + } + }); this.observer = new MutationObserver((mutations: MutationRecord[]) => { mutations.forEach((rec) => { @@ -85,7 +87,9 @@ export default class FolderNotesPlugin extends Plugin { childList: true, subtree: true, }); - this.registerEvent(this.app.workspace.on('layout-change', () => { this.loadFileClasses(); })); + this.registerEvent(this.app.workspace.on('layout-change', () => { + this.loadFileClasses(); + })); this.registerEvent(this.app.vault.on('delete', (file: TAbstractFile) => { if (!(file instanceof TFile)) { return; } // parent is null here even if the parent exists