From 0e4cdda8c749815ddb704afd8fafd9bc90ea7efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Wed, 9 Nov 2022 11:07:45 +0200 Subject: [PATCH] Prevent citation merging from being always enabled after refreshing the doc --- chrome/content/zotero/xpcom/integration.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 8f670a1a6b..b1f7c7ed7d 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -527,6 +527,7 @@ Zotero.Integration = new function() { session._removeCodeFields = {}; session._deleteFields = {}; session._bibliographyFields = []; + session._shouldMerge = false; if (dataString == EXPORTED_DOCUMENT_MARKER) { Zotero.Integration.currentSession = session; @@ -821,7 +822,7 @@ Zotero.Integration.Interface.prototype.addEditBibliography = Zotero.Promise.coro */ Zotero.Integration.Interface.prototype.refresh = async function() { await this._session.init(true, false); - this._session.shouldMerge = true; + this._session._shouldMerge = true; this._session.reload = this._session.reload || this._session.data.prefs.delayCitationUpdates; await this._session.updateFromDocument(FORCE_CITATIONS_REGENERATE); @@ -1103,7 +1104,7 @@ Zotero.Integration.Session.prototype._processFields = async function () { data = await field.unserialize(), citation = new Zotero.Integration.Citation(field, data, noteIndex); - if (this.shouldMerge && typeof field.isAdjacentToNextField === 'function' && await field.isAdjacentToNextField()) { + if (this._shouldMerge && typeof field.isAdjacentToNextField === 'function' && await field.isAdjacentToNextField()) { adjacentCitations.push(citation); this._deleteFields[i] = true; continue;