www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 55688a8104c6b44dfccbd1b6b3ee9502b332cf7e
parent a8e94a8cba2339a32508ce054098ce013eee3af2
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 26 Apr 2016 00:00:12 -0400

Load item data in feed libraries before refreshing feeds

Diffstat:
Mchrome/content/zotero/xpcom/data/feeds.js | 1+
Mchrome/content/zotero/xpcom/data/library.js | 3+++
Mchrome/content/zotero/xpcom/zotero.js | 3++-
3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/data/feeds.js b/chrome/content/zotero/xpcom/data/feeds.js @@ -204,6 +204,7 @@ Zotero.Feeds = new function() { Zotero.debug("Running update for feeds: " + needUpdate.join(', ')); for (let i=0; i<needUpdate.length; i++) { let feed = Zotero.Feeds.get(needUpdate[i]); + yield feed.waitForDataLoad('item'); yield feed._updateFeed(); } diff --git a/chrome/content/zotero/xpcom/data/library.js b/chrome/content/zotero/xpcom/data/library.js @@ -371,6 +371,9 @@ Zotero.Library.prototype.setDataLoaded = function (objectType) { this._dataLoadedDeferreds[objectType].resolve(); }; +/** + * Wait for a given data type to load, loading it now if necessary + */ Zotero.Library.prototype.waitForDataLoad = Zotero.Promise.coroutine(function* (objectType) { if (this.getDataLoaded(objectType)) return; diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -631,7 +631,8 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); yield Zotero.Relations.init(); yield Zotero.Feeds.init(); - // Load all library data except for items + // Load all library data except for items, which are loaded when libraries are first + // clicked on or if otherwise necessary yield Zotero.Promise.each( Zotero.Libraries.getAll(), library => Zotero.Promise.coroutine(function* () {