diff options
Diffstat (limited to 'modern/src/main')
-rw-r--r-- | modern/src/main/DeviceRow.js | 15 |
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 }} |