From b00419ce25e1f3feebcc4b14f55d0cc9f2b5ca1b Mon Sep 17 00:00:00 2001 From: MarekWo Date: Sat, 10 Jan 2026 19:23:40 +0100 Subject: [PATCH] fix: Update filtered count badge when type filter returns empty results The filteredCountBadge in "Add Filtered" button was not updating when unchecking type filter checkboxes resulted in zero matching contacts. Now resets badge to '0' and clears filteredPendingContacts array. Co-Authored-By: Claude Opus 4.5 --- app/static/js/contacts.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/static/js/contacts.js b/app/static/js/contacts.js index 9b15977..221797f 100644 --- a/app/static/js/contacts.js +++ b/app/static/js/contacts.js @@ -701,6 +701,11 @@ async function loadPendingContacts() { // Show empty state if (emptyEl) emptyEl.style.display = 'block'; if (countBadge) countBadge.style.display = 'none'; + + // Reset filtered count badge when no contacts match type filter + const filteredCountBadge = document.getElementById('filteredCountBadge'); + if (filteredCountBadge) filteredCountBadge.textContent = '0'; + filteredPendingContacts = []; } else { // Initialize filtered list and apply filters (default: CLI only) filteredPendingContacts = [...pendingContacts];