Load item data in feed libraries before refreshing feeds
This commit is contained in:
parent
a8e94a8cba
commit
55688a8104
|
@ -204,6 +204,7 @@ Zotero.Feeds = new function() {
|
||||||
Zotero.debug("Running update for feeds: " + needUpdate.join(', '));
|
Zotero.debug("Running update for feeds: " + needUpdate.join(', '));
|
||||||
for (let i=0; i<needUpdate.length; i++) {
|
for (let i=0; i<needUpdate.length; i++) {
|
||||||
let feed = Zotero.Feeds.get(needUpdate[i]);
|
let feed = Zotero.Feeds.get(needUpdate[i]);
|
||||||
|
yield feed.waitForDataLoad('item');
|
||||||
yield feed._updateFeed();
|
yield feed._updateFeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -371,6 +371,9 @@ Zotero.Library.prototype.setDataLoaded = function (objectType) {
|
||||||
this._dataLoadedDeferreds[objectType].resolve();
|
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) {
|
Zotero.Library.prototype.waitForDataLoad = Zotero.Promise.coroutine(function* (objectType) {
|
||||||
if (this.getDataLoaded(objectType)) return;
|
if (this.getDataLoaded(objectType)) return;
|
||||||
|
|
||||||
|
|
|
@ -631,7 +631,8 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
||||||
yield Zotero.Relations.init();
|
yield Zotero.Relations.init();
|
||||||
yield Zotero.Feeds.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(
|
yield Zotero.Promise.each(
|
||||||
Zotero.Libraries.getAll(),
|
Zotero.Libraries.getAll(),
|
||||||
library => Zotero.Promise.coroutine(function* () {
|
library => Zotero.Promise.coroutine(function* () {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user