Use 'async' configOptions property to indicate promisified translators

Instead of >"2017-07-05"

Addresses https://github.com/zotero/translators/issues/1353
This commit is contained in:
Dan Stillman 2017-07-05 15:25:57 -04:00
parent 5ff5ea88fb
commit f7c1c56d7d
2 changed files with 8 additions and 3 deletions

View file

@ -83,7 +83,8 @@ Zotero.Translate.Sandbox = {
_itemDone: function (translate, item) {
// https://github.com/zotero/translators/issues/1353
var asyncTranslator = !(translate instanceof Zotero.Translate.Web)
&& translate.translator[0].lastUpdated > '2017-07-05';
&& translate.translator[0].configOptions
&& translate.translator[0].configOptions.async;
var run = function (resolve) {
Zotero.debug("Translate: Saving item");

View file

@ -850,7 +850,9 @@ describe("Zotero.Translate", function() {
+ " });"
+ "}",
{
lastUpdated: "2017-07-05 00:00:00"
configOptions: {
async: true
}
}
));
var e = yield getPromiseError(translation.translate());
@ -906,7 +908,9 @@ describe("Zotero.Translate", function() {
+ " });"
+ "}",
{
lastUpdated: "2017-07-05 00:00:00"
configOptions: {
async: true
}
}
));
translation.setSearch({ itemType: "journalArticle", DOI: "10.111/Test"});