From 3208c37a86d0e2c556201d4730c77b56927a8222 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Tue, 10 Oct 2023 22:54:29 +0800 Subject: [PATCH] Fixed distance calculation rounding down to 0 and reduced distance threshhold to 1km --- src/components/GetDistance/GetDistanceFromUSTP.tsx | 2 +- src/routes/Home/Home.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/GetDistance/GetDistanceFromUSTP.tsx b/src/components/GetDistance/GetDistanceFromUSTP.tsx index 391df27..e68376c 100644 --- a/src/components/GetDistance/GetDistanceFromUSTP.tsx +++ b/src/components/GetDistance/GetDistanceFromUSTP.tsx @@ -15,6 +15,6 @@ export default function GetDistanceFromUSTP(location: LocationType) { ustpCoords.latitude, ustpCoords.longitude ); - dist = Math.round(dist); + dist = Math.round(dist * 100) / 100; return dist; } diff --git a/src/routes/Home/Home.tsx b/src/routes/Home/Home.tsx index 6f5ca2c..69b0b2f 100644 --- a/src/routes/Home/Home.tsx +++ b/src/routes/Home/Home.tsx @@ -345,7 +345,7 @@ export default function Home() { function CustomMap() { if (dist && location) { - if (dist <= 2 || map_distance_override) { + if (dist <= 1 || map_distance_override) { return ( <>