From 1fe974bd83c8d7489840d0b46875f9cfb683e42a Mon Sep 17 00:00:00 2001 From: Jeremy Valentine <38669521+valentine195@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:10:54 -0400 Subject: [PATCH] fix: Defer watcher until layout ready to help improve launch times --- src/watcher/watcher.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/watcher/watcher.ts b/src/watcher/watcher.ts index 28caf1a..6ccddd7 100644 --- a/src/watcher/watcher.ts +++ b/src/watcher/watcher.ts @@ -291,7 +291,9 @@ export class Watcher extends Component { } ); - this.start(); + this.plugin.app.workspace.onLayoutReady(() => { + this.start(); + }); } start(calendar?: Calendar) { const calendars = calendar ? [calendar] : this.calendars;