From b005a8f30eddbefbf0b9d40bb940e44ce519c395 Mon Sep 17 00:00:00 2001 From: Ross Younger Date: Fri, 19 Jan 2024 00:05:26 +1300 Subject: [PATCH] [newsfeed] Fix bug where the newsfeed sometimes stops (#3361) It appears that #3336 introduced a bug where a newsfeed with >1 items would stop updating after a while (usually after `activeItem` wraps around the end of the list). Sorry! My bad, I hadn't tested that case well enough. --- CHANGELOG.md | 1 + modules/default/newsfeed/newsfeed.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c3268b7..099cb7c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ _This release is scheduled to be released on 2024-04-01._ - [newsfeed] Suppress unsightly animation cases when there are 0 or 1 active news items (#3336) - [newsfeed] Always compute the feed item URL using the same helper function (#3336) - Ignore all custom css files (#3359) +- [newsfeed] Fix newsfeed stall issue introduced by #3336 (#3361) ### Deleted diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index 2ecd2ad6..329c04bb 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -335,7 +335,7 @@ Module.register("newsfeed", { * * (N.B. We set activeItemCount and activeItemHash in getTemplateData().) */ - if (this.newsItems.length !== this.activeItemCount || this.activeItemHash !== this.newsItems[0]?.hash) { + if (this.newsItems.length > 1 || this.newsItems.length !== this.activeItemCount || this.activeItemHash !== this.newsItems[0]?.hash) { this.activeItem++; // this is OK if newsItems.Length==1; getTemplateData will wrap it around this.updateDom(this.config.animationSpeed); }