Fix error in multiple item saving

This commit is contained in:
Simon Kornblith 2011-06-30 02:01:31 +00:00
parent b114266fb3
commit ad04e96ad4

View file

@ -52,7 +52,7 @@ Zotero.Translate.ItemSaver.prototype = {
// attempt to save to server on a timer
if(me._timeoutID) clearTimeout(me._timeoutID);
me._itemsToSaveToServer.push(item);
setTimeout(function() { me._saveToServer() }, 2000);
me._timeoutID = setTimeout(function() { me._saveToServer() }, 2000);
}
});
},
@ -123,6 +123,8 @@ Zotero.Translate.ItemSaver.prototype = {
if(!status) {
Zotero.Messaging.sendMessage("saveDialog_error", status);
throw new Error("Translate: Save to server failed: "+message);
} else {
Zotero.debug("Translate: Save to server complete");
}
}, true);
}