diff options
author | geduxas <gediminas.vileikis@gmail.com> | 2023-09-22 06:33:03 +0000 |
---|---|---|
committer | geduxas <gediminas.vileikis@gmail.com> | 2023-09-22 06:33:03 +0000 |
commit | 4caa00dfbdd3cd9bef480eb6ba79cfe93b789e57 (patch) | |
tree | 81f3b6462bb60c4969d3fff4981b3642e6b9adc3 /modern/src/common/components/PositionValue.jsx | |
parent | 54167a919565d6bafde37c9023c0062cd82fbd65 (diff) | |
download | trackermap-web-4caa00dfbdd3cd9bef480eb6ba79cfe93b789e57.tar.gz trackermap-web-4caa00dfbdd3cd9bef480eb6ba79cfe93b789e57.tar.bz2 trackermap-web-4caa00dfbdd3cd9bef480eb6ba79cfe93b789e57.zip |
Optimization
Diffstat (limited to 'modern/src/common/components/PositionValue.jsx')
-rw-r--r-- | modern/src/common/components/PositionValue.jsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modern/src/common/components/PositionValue.jsx b/modern/src/common/components/PositionValue.jsx index 58841939..64f9dc04 100644 --- a/modern/src/common/components/PositionValue.jsx +++ b/modern/src/common/components/PositionValue.jsx @@ -19,6 +19,7 @@ import { formatVolume, formatConsumption, } from '../util/formatter'; +import { speedToKnots } from '../util/converter'; import { useAttributePreference, usePreference } from '../util/preferences'; import { useTranslation } from './LocalizationProvider'; import { useAdministrator } from '../util/permissions'; @@ -53,8 +54,9 @@ const PositionValue = ({ position, property, attribute }) => { case 'longitude': return formatCoordinate('longitude', value, coordinateFormat); case 'speed': - case 'obdSpeed': return value != null ? formatSpeed(value, speedUnit, t) : ''; + case 'obdSpeed': + return value != null ? formatSpeed(speedToKnots(value, 'kmh'), speedUnit, t) : ''; case 'course': return formatCourse(value); case 'altitude': |