mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Remove on layout ready code block handling
This commit is contained in:
parent
2d34383cd0
commit
8a685f9f16
1 changed files with 7 additions and 14 deletions
21
src/main.ts
21
src/main.ts
|
|
@ -159,18 +159,11 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
if (!this.settings.syncDelete) { return; }
|
||||
this.app.vault.delete(folderNote);
|
||||
}));
|
||||
if (this.app.workspace.layoutReady) {
|
||||
this.registerMarkdownCodeBlockProcessor('folder-overview', (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => {
|
||||
this.handleOverviewBlock(source, el, ctx);
|
||||
});
|
||||
} else {
|
||||
this.app.workspace.onLayoutReady(() => {
|
||||
console.log('layout ready');
|
||||
this.registerMarkdownCodeBlockProcessor('folder-overview', (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => {
|
||||
this.handleOverviewBlock(source, el, ctx);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.registerMarkdownCodeBlockProcessor('folder-overview', (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => {
|
||||
this.handleOverviewBlock(source, el, ctx);
|
||||
});
|
||||
|
||||
if (this.app.workspace.layoutReady) {
|
||||
this.loadFileClasses();
|
||||
} else {
|
||||
|
|
@ -196,8 +189,8 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
subtree: true,
|
||||
});
|
||||
try {
|
||||
const folderOverview = new FolderOverview(this, ctx, source, el);
|
||||
folderOverview.create(this, parseYaml(source), el, ctx);
|
||||
const folderOverview = new FolderOverview(this, ctx, source, el);
|
||||
folderOverview.create(this, parseYaml(source), el, ctx);
|
||||
} catch (e) {
|
||||
new Notice('Error creating folder overview (folder notes plugin) - check console for more details');
|
||||
console.error(e);
|
||||
|
|
|
|||
Loading…
Reference in a new issue