Refresh document with delayed citation updates when changing style

Closes #4974
This commit is contained in:
Adomas Venčkauskas 2025-01-08 14:03:41 +02:00 • committed by Dan Stillman
parent 65461de4f5
commit b5b59062a7

View file

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