From 97a045fe0f0611ebe4ad001b31d82fd02a2d6169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Wed, 31 Jan 2018 12:59:32 +0200 Subject: [PATCH] Fix slow display of citation dialog on first interaction with doc --- chrome/content/zotero/xpcom/integration.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 8bac3705e8..31e8198cdf 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -1174,6 +1174,7 @@ Zotero.Integration.Fields.prototype.addEditCitation = Zotero.Promise.coroutine(f fieldIndexPromise, citationsByItemIDPromise, previewFn ); + Zotero.debug('Integration: Displaying citation dialogue'); if (Zotero.Prefs.get("integration.useClassicAddCitationDialog")) { Zotero.Integration.displayDialog('chrome://zotero/content/integration/addCitationDialog.xul', 'alwaysRaised,resizable', io); @@ -1350,24 +1351,11 @@ Zotero.Integration.Session.prototype.init = Zotero.Promise.coroutine(function *( Zotero.debug("Integration: No document preferences found, but found "+data.prefs.fieldType+" fields"); } } - - if (haveFields && !Object.keys(this.citationsByIndex).length) { - // We should load up the fields on the first interaction with the document, so - // that we can display a list of existing citations, etc. - yield this.fields.get(); - yield this.fields.updateSession(FORCE_CITATIONS_FALSE); - } if (dontRunSetDocPrefs) return false; yield this.setDocPrefs(); } - if (!Object.keys(this.citationsByIndex).length) { - // We should load up the fields on the first interaction with the document, so - // that we can display a list of existing citations, etc. - yield this.fields.get(); - yield this.fields.updateSession(FORCE_CITATIONS_FALSE); - } return true; });