mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 14:44:51 +02:00
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:
parent
29f995d885
commit
b657c0f000
1 changed files with 1 additions and 1 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue