From e169da23db5357de3ca6d9cbb38051816a8878f6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 24 Mar 2023 22:52:42 -0700 Subject: Handle missing values --- modern/src/common/components/PositionValue.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modern/src/common') 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); -- cgit v1.2.3