From c0a8a8efc8bd6a554253c98d0df7f8fd110dafea Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Thu, 23 Nov 2023 23:29:27 +0800 Subject: [PATCH] Always refresh location when pressing refresh button --- src/routes/Home/Home.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/routes/Home/Home.tsx b/src/routes/Home/Home.tsx index aa29b01..21ee76a 100644 --- a/src/routes/Home/Home.tsx +++ b/src/routes/Home/Home.tsx @@ -85,15 +85,8 @@ export default function Home() { if (locationPermitted) { let newLocation = await Location.getCurrentPositionAsync(); if (newLocation) { - // Only update location state if user's location has changed - if ( - !location || - newLocation.coords.latitude !== location.coords.latitude || - newLocation.coords.longitude !== location.coords.longitude - ) { setLocation(newLocation); - await DistanceHandler(newLocation); - } + await DistanceHandler(newLocation); } } }