From 580b9cf5bba3ee39fa17e822a38866d93b6048c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Fri, 7 Aug 2026 07:24:23 +0000 Subject: [PATCH] Citation Explorer: restrict relinking to one item --- chrome/content/zotero/integration/citationExplorer.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/integration/citationExplorer.js b/chrome/content/zotero/integration/citationExplorer.js index 361c201f91..dd36cee3fb 100644 --- a/chrome/content/zotero/integration/citationExplorer.js +++ b/chrome/content/zotero/integration/citationExplorer.js @@ -691,10 +691,10 @@ window.ZoteroCitationExplorer = { let isItemRow = focusedRow instanceof CitationExplorerItemTreeRow; let isUnlinked = isItemRow && !focusedRow.isLinked; let noneItemsSelected = selectedRows.length === 0; - let anyUnlinkedSelected = selectedRows.some(row => !row.isLinked); + let canRelink = selectedRows.length === 1 && selectedRows[0] === focusedRow && isUnlinked; document.querySelector('#button-show-in-zotero').disabled = noneItemsSelected || !isItemRow || isUnlinked; - document.querySelector('#button-relink-item').disabled = noneItemsSelected || !anyUnlinkedSelected; + document.querySelector('#button-relink-item').disabled = !canRelink; document.querySelector('#button-addTo-library').disabled = noneItemsSelected; await this.refreshCitationList(); @@ -704,7 +704,7 @@ window.ZoteroCitationExplorer = { let focusedRow = itemList.getRow(itemList.selection.focused); if (focusedRow instanceof LibraryItemTreeRow) return; - if (!focusedRow.isLinked) { + if (!focusedRow.isLinked && itemList.selection.count === 1) { this.onItemRelink(); } else { @@ -718,7 +718,6 @@ window.ZoteroCitationExplorer = { onItemRelink: async function () { let treeRow = itemList.getRow(itemList.selection.focused); - if (!(treeRow instanceof CitationExplorerItemTreeRow) || treeRow.isLinked) return; let oldItemID = treeRow.id; let io = { dataIn: null, dataOut: null, multiSelect: false, deferred: Zotero.Promise.defer() };