From 5150c90a1e1f910c594bae2beef886ff43d2d04d Mon Sep 17 00:00:00 2001 From: Pujan Date: Tue, 5 Sep 2023 03:57:08 +0530 Subject: [PATCH 1/3] set initial state for confirmed route --- src/components/ConfirmedRoute.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/ConfirmedRoute.js b/src/components/ConfirmedRoute.js index f57fac050c65..7afcfaeddc4d 100644 --- a/src/components/ConfirmedRoute.js +++ b/src/components/ConfirmedRoute.js @@ -93,6 +93,10 @@ function ConfirmedRoute({mapboxAccessToken, transaction}) { accessToken={mapboxAccessToken.token} mapPadding={CONST.MAP_PADDING} pitchEnabled={false} + initialState={{ + zoom: CONST.MAPBOX.DEFAULT_ZOOM, + location: waypointMarkers[0].coordinate, + }} directionCoordinates={coordinates} style={styles.mapView} waypoints={waypointMarkers} From cb962c98c1eaf79b60c243541dd278e6c66eb2d3 Mon Sep 17 00:00:00 2001 From: Pujan Date: Tue, 5 Sep 2023 09:10:48 +0530 Subject: [PATCH 2/3] lodashget for the initial location --- src/components/ConfirmedRoute.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ConfirmedRoute.js b/src/components/ConfirmedRoute.js index 7afcfaeddc4d..ef4d49ecd47e 100644 --- a/src/components/ConfirmedRoute.js +++ b/src/components/ConfirmedRoute.js @@ -95,7 +95,7 @@ function ConfirmedRoute({mapboxAccessToken, transaction}) { pitchEnabled={false} initialState={{ zoom: CONST.MAPBOX.DEFAULT_ZOOM, - location: waypointMarkers[0].coordinate, + location: lodashGet(waypointMarkers , [0, 'coordinate'], CONST.MAPBOX.DEFAULT_COORDINATE), }} directionCoordinates={coordinates} style={styles.mapView} From 85b5b5212d3fd680da06445939d4d17fc1ebc511 Mon Sep 17 00:00:00 2001 From: Pujan Date: Tue, 5 Sep 2023 09:11:41 +0530 Subject: [PATCH 3/3] lint fix --- src/components/ConfirmedRoute.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ConfirmedRoute.js b/src/components/ConfirmedRoute.js index ef4d49ecd47e..aa7c38e0c535 100644 --- a/src/components/ConfirmedRoute.js +++ b/src/components/ConfirmedRoute.js @@ -95,7 +95,7 @@ function ConfirmedRoute({mapboxAccessToken, transaction}) { pitchEnabled={false} initialState={{ zoom: CONST.MAPBOX.DEFAULT_ZOOM, - location: lodashGet(waypointMarkers , [0, 'coordinate'], CONST.MAPBOX.DEFAULT_COORDINATE), + location: lodashGet(waypointMarkers, [0, 'coordinate'], CONST.MAPBOX.DEFAULT_COORDINATE), }} directionCoordinates={coordinates} style={styles.mapView}