From 55c60a69ac1fe88ed374886140ab28d532a28dc4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 13 May 2016 01:20:57 -0400 Subject: [PATCH] Delay feed fetching 5 seconds at startup Would be better not to start until after the initial library's items had been loaded, but that's a little awkward to do from non-window code. Might make more sense when there's only Standalone. --- chrome/content/zotero/xpcom/data/feeds.js | 8 ++++---- chrome/content/zotero/xpcom/zotero.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/feeds.js b/chrome/content/zotero/xpcom/data/feeds.js index 26a3fb338..f3f94df3e 100644 --- a/chrome/content/zotero/xpcom/data/feeds.js +++ b/chrome/content/zotero/xpcom/data/feeds.js @@ -25,6 +25,10 @@ // Mimics Zotero.Libraries Zotero.Feeds = new function() { + this.init = function () { + setTimeout(() => this.scheduleNextFeedCheck(), 5000); + } + this._cache = null; this._makeCache = function() { @@ -69,10 +73,6 @@ Zotero.Feeds = new function() { delete this._cache.libraryIDByURL[url]; } - this.init = function () { - return this.scheduleNextFeedCheck(); - } - this.importFromOPML = Zotero.Promise.coroutine(function* (opmlString) { var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"] .createInstance(Components.interfaces.nsIDOMParser); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index e3f099de2..ed5ca4b54 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -629,7 +629,6 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); yield Zotero.Creators.init(); yield Zotero.Groups.init(); yield Zotero.Relations.init(); - yield Zotero.Feeds.init(); // Load all library data except for items, which are loaded when libraries are first // clicked on or if otherwise necessary @@ -643,8 +642,6 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); ); yield Zotero.QuickCopy.init(); - - Zotero.Items.startEmptyTrashTimer(); } catch (e) { Zotero.logError(e); @@ -744,6 +741,9 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); throw e; }; + Zotero.Items.startEmptyTrashTimer(); + Zotero.Feeds.init(); + return true; } catch (e) {