From b5b59062a7a1824a8a7567549adbb1c805e25e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Wed, 8 Jan 2025 14:03:41 +0200 Subject: [PATCH] Refresh document with delayed citation updates when changing style Closes #4974 --- 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 1b2b8fb776..945be019ac 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -898,7 +898,8 @@ Zotero.Integration.Interface.prototype.setDocPrefs = Zotero.Promise.coroutine(fu // Perform noteType or fieldType conversion let fields = yield this._session.getFields(); - + + const styleHasChanged = oldData.style.styleID != this._session.data.style.styleID; var convertBibliographies = oldData.prefs.fieldType != this._session.data.prefs.fieldType; var convertItems = convertBibliographies || oldData.prefs.noteType != this._session.data.prefs.noteType; @@ -931,7 +932,7 @@ Zotero.Integration.Interface.prototype.setDocPrefs = Zotero.Promise.coroutine(fu this._session._fields = null; this._session.ignoreEmptyBibliography = true; - if (this._session.data.prefs.delayCitationUpdates && !fieldsToConvert.length) return; + if (this._session.data.prefs.delayCitationUpdates && !fieldsToConvert.length && !styleHasChanged) return; yield this._session.updateFromDocument(FORCE_CITATIONS_RESET_TEXT); return this._session.updateDocument(FORCE_CITATIONS_RESET_TEXT, true, true);