diff options
Diffstat (limited to 'modern')
-rw-r--r-- | modern/src/map/PositionsMap.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/modern/src/map/PositionsMap.js b/modern/src/map/PositionsMap.js index b53cbfb..6bd7bcb 100644 --- a/modern/src/map/PositionsMap.js +++ b/modern/src/map/PositionsMap.js @@ -18,13 +18,15 @@ const PositionsMap = ({ positions }) => { const devices = useSelector((state) => state.devices.items); const deviceColor = (device) => { - switch (device.status) { - case 'online': + const position = positions[device.id]; + if (position) { + if (position.attributes.ignition) { return 'green'; - case 'offline': + } else { return 'red'; - default: - return 'gray'; + } + } else { + return 'gray'; } }; |