Skip to content

Commit 05718f8

Browse files
committed
Fix elevation profile not updating when route changes
The height graph data was only fetched when the drawer was expanded/collapsed. Added a useEffect to automatically fetch height data whenever direction results change.
1 parent 7fb8a80 commit 05718f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/map/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ export const MapComponent = () => {
347347
}
348348
}, [directionResults, heightPayload, updateInclineDecline]);
349349

350+
useEffect(() => {
351+
getHeightData();
352+
}, [getHeightData]);
353+
350354
// Update markers when waypoints or isochrone centers change
351355
const geocodeResults = useIsochronesStore((state) => state.geocodeResults);
352356
const markers = useMemo(() => {

0 commit comments

Comments
 (0)