diff options
author | Anton Tananaev <anton@traccar.org> | 2023-03-24 22:52:42 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-03-24 22:52:42 -0700 |
commit | e169da23db5357de3ca6d9cbb38051816a8878f6 (patch) | |
tree | c918db16c7e69c72f2f9bc2d4dec224de2b1b813 /modern/src/common | |
parent | 948bc01d3de990775a232859efff20de330219c0 (diff) | |
download | trackermap-web-e169da23db5357de3ca6d9cbb38051816a8878f6.tar.gz trackermap-web-e169da23db5357de3ca6d9cbb38051816a8878f6.tar.bz2 trackermap-web-e169da23db5357de3ca6d9cbb38051816a8878f6.zip |
Handle missing values
Diffstat (limited to 'modern/src/common')
-rw-r--r-- | modern/src/common/components/PositionValue.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/common/components/PositionValue.js b/modern/src/common/components/PositionValue.js index 27f793c6..6ffed9de 100644 --- a/modern/src/common/components/PositionValue.js +++ b/modern/src/common/components/PositionValue.js @@ -43,15 +43,15 @@ const PositionValue = ({ position, property, attribute }) => { case 'altitude': return formatAltitude(value, altitudeUnit, t); case 'batteryLevel': - return formatPercentage(value, t); + return value ? formatPercentage(value, t) : ''; case 'alarm': return formatAlarm(value, t); case 'odometer': case 'distance': case 'totalDistance': - return formatDistance(value, distanceUnit, t); + return value ? formatDistance(value, distanceUnit, t) : ''; case 'hours': - return formatNumericHours(value, t); + return value ? formatNumericHours(value, t) : ''; default: if (typeof value === 'number') { return formatNumber(value); |