From 6124f8cce2185b83242ac5a6d39f69cec903167b Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:16:28 +0800 Subject: [PATCH] fix: always use workspace to open note in user guide fix: #1007 --- src/hooks.ts | 3 ++- src/modules/userGuide.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hooks.ts b/src/hooks.ts index 820c32f..f6d52f5 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -167,9 +167,10 @@ async function onOpenNote( workspaceUID?: string; lineIndex?: number; sectionName?: string; + forceTakeover?: boolean; } = {}, ) { - if (!getPref("openNote.takeover")) { + if (!options.forceTakeover && !getPref("openNote.takeover")) { ZoteroPane.openNoteWindow(noteId); return; } diff --git a/src/modules/userGuide.ts b/src/modules/userGuide.ts index c39dada..0b70e6b 100644 --- a/src/modules/userGuide.ts +++ b/src/modules/userGuide.ts @@ -117,7 +117,9 @@ You can find more information in the following links: showButtons: ["next"], showProgress: true, onBeforeRender: async ({ state: { step, controller } }) => { - tabID = (await addon.hooks.onOpenNote(noteItem!.id, "tab")) as string; + tabID = (await addon.hooks.onOpenNote(noteItem!.id, "tab", { + forceTakeover: true, + })) as string; if (!tabID) { controller.abort();