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 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-01-10 19:23:40 +01:00
parent 672fb2d1ad
commit b00419ce25
+5
View File
@@ -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];