mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-22 13:09:26 +00:00
[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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user