diff options
author | Iván Ávalos <avalos@disroot.org> | 2021-12-07 19:18:02 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2021-12-07 19:18:02 -0600 |
commit | fdacbe991e0ccea66ab684a2e119607ad95299ee (patch) | |
tree | 909bb48c3896eaf808dd78f036aed1d76a815960 /modern/src | |
parent | be38d879dc5cdcc8f81c9ea13365355f686b2869 (diff) | |
download | etbsa-traccar-web-fdacbe991e0ccea66ab684a2e119607ad95299ee.tar.gz etbsa-traccar-web-fdacbe991e0ccea66ab684a2e119607ad95299ee.tar.bz2 etbsa-traccar-web-fdacbe991e0ccea66ab684a2e119607ad95299ee.zip |
Use ignition instead of status to render label colors in map
Diffstat (limited to 'modern/src')
-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'; } }; |