From c863d45cf01965dd7a126e5d6a7751d9797198fb Mon Sep 17 00:00:00 2001 From: Archos Date: Tue, 9 Jun 2026 09:14:37 +0200 Subject: [PATCH] fix: scope/filter conflict, federated feed funguje --- deni.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/deni.html b/deni.html index ead760d..7db864b 100644 --- a/deni.html +++ b/deni.html @@ -150,7 +150,9 @@ let currentScope = 'local'; function setScope(scope) { currentScope = scope; + currentFilter = 'all'; document.querySelectorAll('[data-scope]').forEach(b => b.classList.toggle('active', b.dataset.scope === scope)); + document.querySelectorAll('.filter-tab[data-filter]').forEach(b => b.classList.toggle('active', b.dataset.filter === 'all')); loadFeed(); } @@ -203,7 +205,7 @@ function renderFeed() { const feed = document.getElementById('feed'); const filtered = currentFilter === 'all' ? allPosts : allPosts.filter(p => postType(p) === currentFilter); if (!filtered.length) { feed.innerHTML = '
Žádné příspěvky.
'; return; } - feed.innerHTML = filtered.map(renderPost).join(''); + try { feed.innerHTML = filtered.map(renderPost).join(''); } catch(e) { console.error('renderFeed error:', e); feed.innerHTML = '
Chyba vykreslování.
'; } } function updateCounts() { @@ -251,9 +253,9 @@ async function loadTopLinks() { } } -document.querySelectorAll('.filter-tab').forEach(btn => { +document.querySelectorAll('.filter-tab[data-filter]').forEach(btn => { btn.addEventListener('click', () => { - document.querySelectorAll('.filter-tab').forEach(b => b.classList.remove('active')); + document.querySelectorAll('.filter-tab[data-filter]').forEach(b => b.classList.remove('active')); btn.classList.add('active'); currentFilter = btn.dataset.filter; renderFeed();