From 14e14b8bb6deba6076b6b43e5d852572b9ecee97 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Wed, 20 Sep 2023 19:53:25 +0800 Subject: [PATCH] Code cleanup --- src/routes/Home/Home.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/Home/Home.tsx b/src/routes/Home/Home.tsx index 2a9cd8d..c8f9718 100644 --- a/src/routes/Home/Home.tsx +++ b/src/routes/Home/Home.tsx @@ -85,7 +85,7 @@ export default function Home() { newLocation.coords.longitude !== location.coords.longitude ) { setLocation(newLocation); - GetDistanceRoundedOff(newLocation); + DistanceHandler(newLocation); } } } @@ -105,9 +105,9 @@ export default function Home() { requestLocation(); }, []); - async function GetDistanceRoundedOff(location: RawLocationType) { + async function DistanceHandler(location: RawLocationType) { let dist = GetDistanceFromUSTP(location.coords); - setDist(Math.round(dist)); + setDist(dist); // Deactivate student status if too far away if (dist >= 2 && !map_debug) mutation.mutate({