www

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

commit b478d8f204609646831b23ccd805a374e7f07431
parent 93e3f68be825f99a7e14b8bdad5a6672dd48b94a
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 24 Feb 2015 22:06:18 -0500

Fix some errors if pane is opened during initialization

Diffstat:
Mchrome/content/zotero/overlay.js | 5+++--
Mchrome/content/zotero/xpcom/zotero.js | 4++--
Mcomponents/zotero-service.js | 5++---
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js @@ -32,7 +32,6 @@ var ZoteroOverlay = new function() var toolbarCollapseState, showInPref; var zoteroPane, zoteroSplitter; var _stateBeforeReload = false; - var _initializationDeferred, _initializationPromise; this.isTab = false; @@ -64,7 +63,7 @@ var ZoteroOverlay = new function() if (!Zotero || Zotero.skipLoading) { throw true; } - return Zotero.unlockPromise; + return Zotero.Promise.all([Zotero.initializationPromise, Zotero.unlockPromise]); }) .then(function () { Zotero.debug("Initializing overlay"); @@ -165,6 +164,8 @@ var ZoteroOverlay = new function() }); }) .catch(function (e) { + Zotero.debug(e, 1); + Components.utils.reportError(e); var errMsg = Zotero ? Zotero.startupError : null; // Use defaults if necessary if (!errMsg) { diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -580,8 +580,6 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); try { var updated = yield Zotero.Schema.updateSchema(); - - Zotero.locked = false; yield Zotero.Users.init(); yield Zotero.Libraries.init(); @@ -592,6 +590,8 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); yield Zotero.CharacterSets.init(); yield Zotero.FileTypes.init(); + Zotero.locked = false; + // Initialize various services Zotero.Styles.preinit(); Zotero.Integration.init(); diff --git a/components/zotero-service.js b/components/zotero-service.js @@ -316,13 +316,12 @@ function ZoteroService() { }) .then(function () { zContext.Zotero.debug("Initialized in "+(Date.now() - start)+" ms"); - }) - .done(); + isFirstLoadThisSession = false; + }); } else { zContext.Zotero.debug("Already initialized"); } - isFirstLoadThisSession = false; this.wrappedJSObject = zContext.Zotero; } catch(e) { var msg = typeof e == 'string' ? e : e.name;