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