commit 3acdc18d88e0245d8d881d3caa5d5e05815cbf43
parent 255041556abd571fbaf562e2d105425fd14d0309
Author: Simon Kornblith <simon@simonster.com>
Date: Mon, 10 Jan 2011 21:41:01 +0000
fix report of translation failure in standalone
Diffstat:
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
@@ -664,11 +664,14 @@ Zotero.Translate.Base.prototype = {
Zotero.debug("Translate: WARNING: Zotero.done() called after translation completion; please fix your code");
return;
}
+ var oldState = this._currentState;
+ this._currentState = null;
+ this._waitForCompletion = false;
var errorString = null;
if(!returnValue) errorString = this._generateErrorString(error);
- if(this._currentState === "detect") {
+ if(oldState === "detect") {
if(this._potentialTranslators.length) {
var lastTranslator = this._potentialTranslators.shift();
@@ -708,8 +711,6 @@ Zotero.Translate.Base.prototype = {
this._runHandler("done", returnValue);
}
- this._waitForCompletion = false;
- this._currentState = null;
return errorString;
},