Fix import
This commit is contained in:
parent
a750203f4f
commit
d5fa7be95a
2 changed files with 9 additions and 3 deletions
|
@ -1199,6 +1199,7 @@ Zotero.Translate.Base.prototype = {
|
||||||
deferredProgress[i][1], deferredProgress[i][2]);
|
deferredProgress[i][1], deferredProgress[i][2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
me.newItems = me.newItems.concat(newItems);
|
||||||
me._savingItems--;
|
me._savingItems--;
|
||||||
me._checkIfDone();
|
me._checkIfDone();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1208,8 +1209,10 @@ Zotero.Translate.Base.prototype = {
|
||||||
},
|
},
|
||||||
function(attachment, progress, error) {
|
function(attachment, progress, error) {
|
||||||
var attachmentIndex = me._savingAttachments.indexOf(attachment);
|
var attachmentIndex = me._savingAttachments.indexOf(attachment);
|
||||||
if((progress === false || progress === 100) && attachmentIndex !== -1) {
|
if(progress === false || progress === 100) {
|
||||||
me._savingAttachments.splice(attachmentIndex, 1);
|
if(attachmentIndex !== -1) {
|
||||||
|
me._savingAttachments.splice(attachmentIndex, 1);
|
||||||
|
}
|
||||||
} else if(attachmentIndex === -1) {
|
} else if(attachmentIndex === -1) {
|
||||||
me._savingAttachments.push(attachment);
|
me._savingAttachments.push(attachment);
|
||||||
}
|
}
|
||||||
|
@ -1231,6 +1234,9 @@ Zotero.Translate.Base.prototype = {
|
||||||
* Checks if saving done, and if so, fires done event
|
* Checks if saving done, and if so, fires done event
|
||||||
*/
|
*/
|
||||||
"_checkIfDone":function() {
|
"_checkIfDone":function() {
|
||||||
|
Zotero.debug(this._savingItems);
|
||||||
|
Zotero.debug(this._savingAttachments.length);
|
||||||
|
Zotero.debug(this._currentState);
|
||||||
if(!this._savingItems && !this._savingAttachments.length && !this._currentState) {
|
if(!this._savingItems && !this._savingAttachments.length && !this._currentState) {
|
||||||
this._runHandler("done", true);
|
this._runHandler("done", true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,7 +216,7 @@ Zotero.Translate.ItemSaver.prototype = {
|
||||||
return topLevelCollection;
|
return topLevelCollection;
|
||||||
},
|
},
|
||||||
|
|
||||||
"_saveAttachmentFile":function(attachment, parentID) {
|
"_saveAttachmentFile":function(attachment, parentID, attachmentCallback) {
|
||||||
const urlRe = /(([A-Za-z]+):\/\/[^\s]*)/i;
|
const urlRe = /(([A-Za-z]+):\/\/[^\s]*)/i;
|
||||||
Zotero.debug("Translate: Adding attachment", 4);
|
Zotero.debug("Translate: Adding attachment", 4);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue