Skip to content

Commit

Permalink
fix: coverage (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno authored Aug 13, 2020
1 parent 6c7f3e4 commit 84a217e
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/FeedManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,17 @@ class FeedManager {
* @param {boolean} firstload whether or not this is the first load on the manager
*/
async getContent(firstload) {
try {
const items = await this.feed.fetchData();
const data = {
items,
url: this.feed.url,
};
this.feed.updateHxLength(items);
this.sortItemsByDate(data);
this.identifyNewItems(data);
this.populateNewItemsInFeed(data, firstload);
if (firstload && !this.instance.skipFirstLoad) {
this.instance.emit(`initial-load:${this.feed.url}`, { url: this.feed.url, items: this.feed.items });
}
} catch (e) {
this.onError(e);
const items = await this.feed.fetchData();
const data = {
items,
url: this.feed.url,
};
this.feed.updateHxLength(items);
this.sortItemsByDate(data);
this.identifyNewItems(data);
this.populateNewItemsInFeed(data, firstload);
if (firstload && !this.instance.skipFirstLoad) {
this.instance.emit(`initial-load:${this.feed.url}`, { url: this.feed.url, items: this.feed.items });
}
}
}
Expand Down

0 comments on commit 84a217e

Please sign in to comment.