diff --git a/script.js b/script.js index cf63ace..9915b57 100644 --- a/script.js +++ b/script.js @@ -1486,8 +1486,12 @@ function renderTickets() { }); } + const showClosed = document.getElementById('ticket-show-closed').checked; const openCount = tickets.filter(t => t.status !== 'suljettu').length; - document.getElementById('ticket-count').textContent = `${openCount} avointa tikettiƤ (${tickets.length} yht.)`; + const closedCount = tickets.filter(t => t.status === 'suljettu').length; + let countText = `${openCount} avointa tikettiƤ`; + if (showClosed && closedCount > 0) countText += ` (${closedCount} suljettua)`; + document.getElementById('ticket-count').textContent = countText; // Status summary const counts = {};