Parcourir la source

fix: do not report PRIORITY_HIDDEN feeds in nbUnreadsPerFeed (#8715)

The sidebar does not render DOM elements for PRIORITY_HIDDEN feeds
(aside_feed.phtml:114), but nbUnreadsPerFeed still reports their unread
counts. In refreshUnreads(), the per-feed tracked count for the missing
element stays at 0 while the server keeps reporting unreads > 0, which
triggers the "new articles available" banner every poll cycle on the
"All articles" view.

Filter hidden feeds from the response, matching the convention already
used in Category.php:42.

Fixes https://github.com/FreshRSS/FreshRSS/issues/8694

Co-authored-by: Bjørn A. Andersen <polybjorn@users.noreply.github.com>
polybjorn il y a 3 semaines
Parent
commit
244d916966
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      app/views/javascript/nbUnreadsPerFeed.phtml

+ 3 - 1
app/views/javascript/nbUnreadsPerFeed.phtml

@@ -8,7 +8,9 @@ $result = [
 ];
 foreach ($this->categories as $cat) {
 	foreach ($cat->feeds() as $feed) {
-		$result['feeds'][$feed->id()] = $feed->nbNotRead();
+		if ($feed->priority() > FreshRSS_Feed::PRIORITY_HIDDEN) {
+			$result['feeds'][$feed->id()] = $feed->nbNotRead();
+		}
 	}
 }
 foreach ($this->tags as $tag) {