mirror of
https://github.com/ajvpot/meshexplorer.git
synced 2026-06-28 22:00:58 +02:00
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:
@@ -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]]
|
||||
|
||||
Reference in New Issue
Block a user