From 50143fcb8e9284e9f24c0234314f7ba5266c20bc Mon Sep 17 00:00:00 2001 From: Ben Kugler Date: Mon, 21 Oct 2024 13:49:40 -0700 Subject: [PATCH] add 'Fix open of Full Calendar view if it already exists #566' --- src/main.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 558eda4..c01e622 100644 --- a/src/main.ts +++ b/src/main.ts @@ -78,9 +78,11 @@ export default class FullCalendarPlugin extends Plugin { active: true, }); } else { - await Promise.all( - leaves.map((l) => (l.view as CalendarView).onOpen()) - ); + const leaf = leaves[0]; + await leaf.setViewState({ + type: FULL_CALENDAR_VIEW_TYPE, + active: true, + }); } } async onload() {