Skip to content

Commit b238c68

Browse files
committed
fix: search bar - fix mx_records object iteration and async data load
1 parent f89c478 commit b238c68

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,7 +2595,7 @@ <h3>Open source &amp; open data</h3>
25952595
return dnsData.municipalities.filter(function(m) {
25962596
return m.name.toLowerCase().includes(ql)
25972597
|| (m.domain && m.domain.toLowerCase().includes(ql))
2598-
|| (m.classification && m.classification.mx_records && m.classification.mx_records.some(function(r) { return r.toLowerCase().includes(ql); }));
2598+
|| (m.classification && m.classification.mx_records && m.classification.mx_records.some(function(r) { return (r.host || '').toLowerCase().includes(ql); }));
25992599
}).slice(0, 8);
26002600
}
26012601

@@ -2620,9 +2620,12 @@ <h3>Open source &amp; open data</h3>
26202620
resultsEl.style.display = 'block';
26212621
}
26222622

2623-
input.addEventListener('input', function() {
2623+
input.addEventListener('input', async function() {
26242624
const q = input.value.trim();
2625-
if (!summaryLoaded || q.length < 2) { resultsEl.style.display = 'none'; return; }
2625+
if (q.length < 2) { resultsEl.style.display = 'none'; return; }
2626+
if (!summaryLoaded) {
2627+
await loadSummaryData();
2628+
}
26262629
render(searchMunis(q));
26272630
});
26282631

0 commit comments

Comments
 (0)