www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 909b4b31c80dc83fa58c74a1f3e6d692cf4f399f
parent d73fc63273ca69e7ac4427001bed3735bcc02a6b
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed,  5 Jul 2017 08:52:37 -0400

Assume import translators updated after today are async

See https://github.com/zotero/translators/issues/1353 for details.

minVersion is problematic for various reasons, so this is safer.

Diffstat:
Mchrome/content/zotero/xpcom/translation/translate.js | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js @@ -81,8 +81,9 @@ Zotero.Translate.Sandbox = { * @param {SandboxItem} An item created using the Zotero.Item class from the sandbox */ _itemDone: function (translate, item) { - var asyncTranslator = translate.translator[0].minVersion - && parseInt(translate.translator[0].minVersion.match(/^[0-9]+/)[0]) >= 5; + // https://github.com/zotero/translators/issues/1353 + var asyncTranslator = translate instanceof Zotero.Translate.Import + && translate.translator[0].lastUpdated > '2017-07-05'; var run = function (resolve) { Zotero.debug("Translate: Saving item"); @@ -205,7 +206,7 @@ Zotero.Translate.Sandbox = { // For synchronous import (when Promise isn't available in the sandbox or the do* // function doesn't use it) and web translators, queue saves - if (!resolve || translate instanceof Zotero.Translate.Web || !asyncTranslator) { + if (!resolve || !asyncTranslator) { Zotero.debug("Translate: Saving via queue"); translate.saveQueue.push(item); if (resolve) {