diff --git a/src/store/location.ts b/src/store/location.ts index f5a67c1..75d792d 100644 --- a/src/store/location.ts +++ b/src/store/location.ts @@ -64,6 +64,9 @@ export class LocationStore { getDistance(loc: GpsLocation, accuracy?: number) { if (!this._location) return null - return getDistance(this._location, loc, accuracy) + const distance = getDistance(this._location, loc, accuracy || 10) + return distance >= 1000 + ? `${Number(distance / 1000).toFixed(1)}km` + : `${distance}m` } } diff --git a/src/ui/group/group-detail-screen.tsx b/src/ui/group/group-detail-screen.tsx index 8b0f59b..882a620 100644 --- a/src/ui/group/group-detail-screen.tsx +++ b/src/ui/group/group-detail-screen.tsx @@ -48,11 +48,7 @@ export const GroupDetailScreen: React.FC = (props) => { > - {locationStore.getDistance( - geoinfoToGpsLocation(data.gps_geoinfo), - 10, - )} - m + {locationStore.getDistance(geoinfoToGpsLocation(data.gps_geoinfo))}

{data.title}

{locationStore.getDistance( geoinfoToGpsLocation(data.gps_geoinfo), - 10, )} - m

{data.title}

diff --git a/src/ui/match/match-request-item.tsx b/src/ui/match/match-request-item.tsx index 25b093d..cf36537 100644 --- a/src/ui/match/match-request-item.tsx +++ b/src/ui/match/match-request-item.tsx @@ -50,9 +50,7 @@ export const MatchRequestItem: React.FC<{ {locationStore.getDistance( geoinfoToGpsLocation(group.gps_geoinfo), - 10, )} - m ) : (