Front matter title bug fix

This commit is contained in:
Lost Paul 2023-08-02 15:54:17 +02:00
parent b40b81bf98
commit 8f91a53fed
2 changed files with 9 additions and 5 deletions

View file

@ -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",

View file

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