From 19d19c3dd5ccece39cbb7a93f83d1bb40e7cbd8c Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Fri, 22 Sep 2023 23:08:54 +0800 Subject: [PATCH] Reflect user pin location change if user manually overrides location --- src/routes/Home/Home.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/routes/Home/Home.tsx b/src/routes/Home/Home.tsx index 3a0317a..10f15ca 100644 --- a/src/routes/Home/Home.tsx +++ b/src/routes/Home/Home.tsx @@ -243,8 +243,12 @@ export default function Home() { minZoomLevel={19} zoomTapEnabled initialRegion={{ - latitude: location.coords.latitude, - longitude: location.coords.longitude, + latitude: + student_status?.location?.latitude || + location.coords.latitude, + longitude: + student_status?.location?.longitude || + location.coords.longitude, latitudeDelta: 0.4, longitudeDelta: 0.4, }} @@ -372,11 +376,16 @@ export default function Home() { } )} { const newLocation = e.nativeEvent.coordinate; const distance = GetDistance(