fix: always use workspace to open note in user guide

fix: #1007
This commit is contained in:
windingwind 2024-06-24 12:16:28 +08:00
parent 297bc08105
commit 6124f8cce2
2 changed files with 5 additions and 2 deletions

View File

@ -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;
}

View File

@ -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();