Skip to content

Commit a543150

Browse files
authored
DRY: Use already defined method isFoot to determine type of profile (#452)
1 parent fd23990 commit a543150

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/pathDetails/elevationWidget/colors.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ApiImpl } from '@/api/Api'
2+
13
export const SURFACE_COLORS: Record<string, string> = {
24
// Paved (greens)
35
asphalt: '#2E7D32',
@@ -134,7 +136,7 @@ export function getSpeedThresholds(profile: string): number[] {
134136
profile.includes('scooter') ||
135137
profile.includes('bus') ||
136138
profile.includes('motorcycle')
137-
const isFootLike = profile.includes('hike') || profile.includes('foot')
139+
const isFootLike = ApiImpl.isFootLike(profile)
138140

139141
if (isMotorVehicle) return [30, 50, 80]
140142
if (isFootLike) return [3, 4, 5]

0 commit comments

Comments
 (0)