Files
FreshRSS/app/views/javascript/nbUnreadsPerFeed.phtml
polybjorn 244d916966 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>
2026-04-24 10:01:49 +02:00

20 lines
428 B
PHTML

<?php
declare(strict_types=1);
/** @var FreshRSS_ViewJavascript $this */
$result = [
'feeds' => [],
'tags' => [],
];
foreach ($this->categories as $cat) {
foreach ($cat->feeds() as $feed) {
if ($feed->priority() > FreshRSS_Feed::PRIORITY_HIDDEN) {
$result['feeds'][$feed->id()] = $feed->nbNotRead();
}
}
}
foreach ($this->tags as $tag) {
$result['tags'][$tag->id()] = $tag->nbUnread();
}
echo json_encode($result);