diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index b4d4c7d060..02eab15991 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -1768,9 +1768,15 @@ Zotero.Integration.CitationEditInterface.prototype = { * Accept changes to the citation * @param {Function} [progressCallback] A callback to be run when progress has changed. * Receives a number from 0 to 100 indicating current status. + * @param {Boolean} [force] Whether to run accept even if it has been run previously. */ - "accept":function(progressCallback) { + "accept":function(progressCallback, force) { var me = this; + + // Don't allow accept to be called multiple times + if(!force && this._haveAccepted) return; + this._haveAccepted = true; + this._fields.progressCallback = progressCallback; if(this._errorOccurred) { @@ -1779,7 +1785,7 @@ Zotero.Integration.CitationEditInterface.prototype = { Zotero.setTimeout(function() { me._fields.updateSession(function() { me._errorOccurred = false; - me.accept(progressCallback); + me.accept(progressCallback, true); }) }, 0); return;