Fix some errors if pane is opened during initialization
This commit is contained in:
parent
93e3f68be8
commit
b478d8f204
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user