Skip to content

Commit 46e9c2e

Browse files
committed
fix main calendar not opening with sidebar calendar
1 parent e40f7c3 commit 46e9c2e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export default class FullCalendarPlugin extends Plugin {
2222
processFrontmatter = toEventInput;
2323

2424
async activateView() {
25-
const leaves = this.app.workspace.getLeavesOfType(
26-
FULL_CALENDAR_VIEW_TYPE
27-
);
25+
const leaves = this.app.workspace
26+
.getLeavesOfType(FULL_CALENDAR_VIEW_TYPE)
27+
.filter((l) => (l.view as CalendarView).inSidebar === false);
2828
if (leaves.length === 0) {
2929
const leaf = this.app.workspace.getLeaf("tab");
3030
await leaf.setViewState({

0 commit comments

Comments
 (0)