From e8046d8ad256ca429dff75ad660ec9ad7972ad30 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 2 Feb 2016 05:30:05 -0500 Subject: [PATCH] Use Promise.coroutine() instead of Zotero.spawn() for saveItems() (Use -w for diff) --- .../xpcom/translation/translate_item.js | 134 +++++++++--------- 1 file changed, 66 insertions(+), 68 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js index fa6239fa7..9ce24373a 100644 --- a/chrome/content/zotero/xpcom/translation/translate_item.js +++ b/chrome/content/zotero/xpcom/translation/translate_item.js @@ -81,84 +81,82 @@ Zotero.Translate.ItemSaver.prototype = { * save progress. The callback will be called as attachmentCallback(attachment, false, error) * on failure or attachmentCallback(attachment, progressPercent) periodically during saving. */ - "saveItems":function(items, callback, attachmentCallback) { - Zotero.spawn(function* () { - try { - let newItems = [], standaloneAttachments = []; - yield (Zotero.DB.executeTransaction(function* () { - for (let iitem=0; iitem