mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 14:50:00 -07:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user