Fix regression in b8ad18e96d
We're relying on Bluebird's synchronous promise inspection for noWait translate mode (as used in Quick Copy). We should decide if we want to keep the Bluebird dependency or rewrite this to use native promises (e.g., with a separate synchronous `_loadTranslator()` function for noWait mode), but for now just restore the `Zotero.Promise.method()`.
This commit is contained in:
parent
ebc21742dd
commit
06075a25c0
1 changed files with 3 additions and 4 deletions
|
@ -1756,7 +1756,7 @@ Zotero.Translate.Base.prototype = {
|
||||||
* @param {Zotero.Translator} translator
|
* @param {Zotero.Translator} translator
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
_loadTranslator: async function (translator) {
|
_loadTranslator: Zotero.Promise.method(function (translator) {
|
||||||
var sandboxLocation = this._getSandboxLocation();
|
var sandboxLocation = this._getSandboxLocation();
|
||||||
if(!this._sandboxLocation || sandboxLocation !== this._sandboxLocation) {
|
if(!this._sandboxLocation || sandboxLocation !== this._sandboxLocation) {
|
||||||
this._sandboxLocation = sandboxLocation;
|
this._sandboxLocation = sandboxLocation;
|
||||||
|
@ -1805,10 +1805,9 @@ Zotero.Translate.Base.prototype = {
|
||||||
parse(codePromise.value());
|
parse(codePromise.value());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let code = await translator.getCode();
|
return translator.getCode().then(parse);
|
||||||
await parse(code);
|
|
||||||
}
|
}
|
||||||
},
|
}),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a sandbox for scraping/scraper detection
|
* Generates a sandbox for scraping/scraper detection
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue