From b657c0f00053a36fc335f35d76a32b93c71e11ed Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 29 Apr 2026 23:12:37 +0000 Subject: [PATCH] fix(map): re-trigger boundary render when API data arrives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The boundary useEffect was only triggered when selectedPlace changed, but boundary data arrives asynchronously from /api/place fetch. By the time fetchPlaceDetails completed and enriched selectedPlace with boundary, the useEffect had already fired and saw no boundary. Fix: add selectedPlace?.boundary to the dependency array so the effect re-runs when boundary data is populated by the API response. Test sequence: - Click Twin Falls → boundary shows on first click - Click Kimberly → boundary shows on first click (was broken) - Click empty map → boundary clears - Click Twin Falls again → boundary shows on first click Co-Authored-By: Claude Opus 4.5 --- src/components/MapView.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MapView.jsx b/src/components/MapView.jsx index a79c545..e2cba53 100644 --- a/src/components/MapView.jsx +++ b/src/components/MapView.jsx @@ -1724,7 +1724,7 @@ const MapView = forwardRef(function MapView(_, ref) { map.once('load', updateBoundary) return () => map.off('load', updateBoundary) } - }, [selectedPlace]) + }, [selectedPlace, selectedPlace?.boundary]) // Update route polyline when route changes useEffect(() => {