mirror of
https://github.com/zotero/zotero.git
synced 2026-10-04 02:31:47 +00:00
Prevent accept from being called twice
This commit is contained in:
parent
65a024e980
commit
ca994fd22b
1 changed files with 8 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue