fix(map): re-trigger boundary render when API data arrives

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 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-04-29 23:12:37 +00:00
commit b657c0f000

View file

@ -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(() => {