aboutsummaryrefslogtreecommitdiff
path: root/modern/src/main/DeviceRow.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-04-23 07:57:34 -0700
committerAnton Tananaev <anton@traccar.org>2023-04-23 07:57:34 -0700
commit8bf5fd13490ef4b288315e507d8554d7aa356b23 (patch)
tree782c952825467f8578297ed27a08348df19ee1cd /modern/src/main/DeviceRow.js
parent4dbdea0ba08b02b5bce673dba1447765fd4e3515 (diff)
downloadtrackermap-web-8bf5fd13490ef4b288315e507d8554d7aa356b23.tar.gz
trackermap-web-8bf5fd13490ef4b288315e507d8554d7aa356b23.tar.bz2
trackermap-web-8bf5fd13490ef4b288315e507d8554d7aa356b23.zip
Remove geofence ids
Diffstat (limited to 'modern/src/main/DeviceRow.js')
-rw-r--r--modern/src/main/DeviceRow.js15
1 files changed, 2 insertions, 13 deletions
diff --git a/modern/src/main/DeviceRow.js b/modern/src/main/DeviceRow.js
index bf5aec3e..4dac8128 100644
--- a/modern/src/main/DeviceRow.js
+++ b/modern/src/main/DeviceRow.js
@@ -62,17 +62,6 @@ const DeviceRow = ({ data, index, style }) => {
const devicePrimary = useAttributePreference('devicePrimary', 'name');
const deviceSecondary = useAttributePreference('deviceSecondary', '');
- const formatProperty = (key) => {
- if (key === 'geofenceIds') {
- const geofenceIds = item[key] || [];
- return geofenceIds
- .filter((id) => geofences.hasOwnProperty(id))
- .map((id) => geofences[id].name)
- .join(', ');
- }
- return item[key];
- };
-
const secondaryText = () => {
let status;
if (item.status === 'online' || !item.lastUpdate) {
@@ -82,7 +71,7 @@ const DeviceRow = ({ data, index, style }) => {
}
return (
<>
- {deviceSecondary && item[deviceSecondary] && `${formatProperty(deviceSecondary)} • `}
+ {deviceSecondary && item[deviceSecondary] && `${item[deviceSecondary]} • `}
<span className={classes[getStatusColor(item.status)]}>{status}</span>
</>
);
@@ -101,7 +90,7 @@ const DeviceRow = ({ data, index, style }) => {
</Avatar>
</ListItemAvatar>
<ListItemText
- primary={formatProperty(devicePrimary)}
+ primary={item[deviceSecondary]}
primaryTypographyProps={{ noWrap: true }}
secondary={secondaryText()}
secondaryTypographyProps={{ noWrap: true }}