mirror of
https://github.com/traccar/traccar-web.git
synced 2025-01-07 03:26:42 +08:00
Handle undefined position values
This commit is contained in:
parent
599369694e
commit
274ee5256b
@ -93,6 +93,10 @@ const PositionValue = ({ position, property, attribute }) => {
|
||||
}
|
||||
};
|
||||
|
||||
if (value === undefined) {
|
||||
return '';
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
case 'image':
|
||||
case 'video':
|
||||
@ -110,20 +114,11 @@ const PositionValue = ({ position, property, attribute }) => {
|
||||
case 'address':
|
||||
return <AddressValue latitude={position.latitude} longitude={position.longitude} originalAddress={value} />;
|
||||
case 'network':
|
||||
if (value) {
|
||||
return <Link component={RouterLink} underline="none" to={`/network/${position.id}`}>{t('sharedInfoTitle')}</Link>;
|
||||
}
|
||||
return '';
|
||||
return <Link component={RouterLink} underline="none" to={`/network/${position.id}`}>{t('sharedInfoTitle')}</Link>;
|
||||
case 'geofenceIds':
|
||||
if (value) {
|
||||
return <GeofencesValue geofenceIds={value} />;
|
||||
}
|
||||
return '';
|
||||
return <GeofencesValue geofenceIds={value} />;
|
||||
case 'driverUniqueId':
|
||||
if (value) {
|
||||
return <DriverValue driverUniqueId={value} />;
|
||||
}
|
||||
return '';
|
||||
return <DriverValue driverUniqueId={value} />;
|
||||
default:
|
||||
return formatValue(value);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user