Count the shown News section in the panel header

With Local chosen, the header counted the Conflicts feed's cards instead of
the Local list's.
This commit is contained in:
Denis Groshev committed 2026-11-06 00:45:30 +01:00
1 parent 74d40c4b1a
commit fa736a7cd5
2 files changed
+9 -1

No files matched your search

+4 -1
View File
@@ -33,7 +33,10 @@ export function createNewsPanel({ container, setLayerParams = () => {} } = {}) {
renderVue(h(NewsFeed, { view, onParams }), container);
const hidden = !view;
if (panel) set(panel, 'hidden', hidden);
if (count) set(count, 'textContent', String(view?.items.length ?? 0));
// The count is the shown section's: Local's list, else the feed.
const shown =
view?.filters?.section === 'local' ? view.inView?.items : view?.items;
if (count) set(count, 'textContent', String(shown?.length ?? 0));
if (!hidden && panel && !appearedPanels.has(panel)) {
appearedPanels.add(panel);
// First appearance opens the panel unless a stored or shared collapse