Refetch map neighbors when the selected region changes

fetchNodes() reads config.selectedRegion but its useCallback dep array
omitted it, so changing the region produced a stale closure that refetched
with the previous region — neighbor lines stayed on the old region until a
full page refresh. Add config.selectedRegion to the dep array so the fetch
picks up the new region immediately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Vanderpot
2026-06-19 02:15:11 -04:00
parent 421ab43153
commit 3943e6515e
+1 -1
View File
@@ -696,7 +696,7 @@ export default function MapView({ target = '_self' }: MapViewProps = {}) {
setAllNeighborsLoading(false);
}
});
}, [mapLayerSettings.nodeTypes, config?.lastSeen]);
}, [mapLayerSettings.nodeTypes, config?.lastSeen, config?.selectedRegion]);
function isBoundsInside(inner: [[number, number], [number, number]], outer: [[number, number], [number, number]]) {
// inner: [[minLat, minLng], [maxLat, maxLng]]