Skip to content

Commit 00edbe4

Browse files
claremacraemnaoumov
andcommitted
fix: Only execute searches once all plugins are loaded.
This fixed use of a "CodeScript Toolkit" startup script inside notes that were already open in Reading mode when Obsidian was starting up. It may also reduce the Tasks plugin impact on start-up time too. Co-Authored-By: Michael Naumov <[email protected]>
1 parent 2493c66 commit 00edbe4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,14 @@ export default class TasksPlugin extends Plugin {
5555
workspace: this.app.workspace,
5656
events,
5757
});
58-
this.inlineRenderer = new InlineRenderer({ plugin: this });
59-
this.queryRenderer = new QueryRenderer({ plugin: this, events });
58+
59+
this.app.workspace.onLayoutReady(() => {
60+
// Only execute searches once all plugins are loaded.
61+
// This fixed use of a "CodeScript Toolkit" startup script inside
62+
// notes that were already open in Reading mode when Obsdian was starting up.
63+
this.inlineRenderer = new InlineRenderer({ plugin: this });
64+
this.queryRenderer = new QueryRenderer({ plugin: this, events });
65+
});
6066

6167
this.registerEditorExtension(newLivePreviewExtension());
6268
this.registerEditorSuggest(new EditorSuggestor(this.app, getSettings(), this));

0 commit comments

Comments
 (0)