From b441a2fb66095e5ace9f939e33101cdca4699a08 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Sat, 24 Aug 2024 10:41:55 +0800 Subject: [PATCH] fix: open empty note in tab --- src/modules/workspace/tab.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/workspace/tab.ts b/src/modules/workspace/tab.ts index c3e7d38..c40cde5 100644 --- a/src/modules/workspace/tab.ts +++ b/src/modules/workspace/tab.ts @@ -19,8 +19,10 @@ export async function openWorkspaceTab( scrollTabEditorTo(item, options); return currentTab.id; } - // @ts-ignore fix uncaught error when called during startup - await waitUtilAsync(() => typeof item._noteTitle === "string"); + if (item.getNote()) { + // @ts-ignore fix uncaught error when called during startup + await waitUtilAsync(() => typeof item._noteTitle === "string"); + } const { id, container } = Zotero_Tabs.add({ type: TAB_TYPE, title: item.getNoteTitle(),