diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index 937fbcd68..fcfe615eb 100644 --- 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 index 29f73c9ae..b8b4ae218 100644 --- 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 index 47ecd04b2..3045be72d 100644 --- 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;