fix: Sync Meshtastic node count between map and top bar

The map was showing correct node count from API while the top bar
showed 0 because uniqueNodes Set was only populated from messages.
Now loadNodes() adds nodes to uniqueNodes and updates stats.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-28 22:35:44 +00:00
parent d821e19334
commit f3c5d124b5

View File

@@ -533,11 +533,17 @@ const Meshtastic = (function() {
// Update markers for all nodes with positions
data.nodes.forEach(node => {
// Track node in uniqueNodes set for stats
if (node.num) uniqueNodes.add(node.num);
if (node.has_position) {
updateNodeMarker(node);
}
});
// Update stats to reflect loaded nodes
updateStats();
// Fit map to show all nodes if we have any
const nodesWithPos = data.nodes.filter(n => n.has_position);
if (nodesWithPos.length > 0 && meshMap) {