From 3943e6515ea252edeb9c35772e70d1aecea4b6f1 Mon Sep 17 00:00:00 2001 From: Alex Vanderpot Date: Fri, 19 Jun 2026 02:15:11 -0400 Subject: [PATCH] Refetch map neighbors when the selected region changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- meshexplorer/src/components/MapView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshexplorer/src/components/MapView.tsx b/meshexplorer/src/components/MapView.tsx index 3234eea..63ea3d2 100644 --- a/meshexplorer/src/components/MapView.tsx +++ b/meshexplorer/src/components/MapView.tsx @@ -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]]