aboutsummaryrefslogtreecommitdiff
path: root/modern/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-28 07:12:32 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-28 07:12:32 -0700
commit2fde351d087141a0cc75cf8fda97458d56f30f1e (patch)
tree0cc336d47e45ba40ea5f78e191bf22632f37374b /modern/src
parent4ec80fe786c852ff78a24a3a0f23065393b577d7 (diff)
downloadtrackermap-web-2fde351d087141a0cc75cf8fda97458d56f30f1e.tar.gz
trackermap-web-2fde351d087141a0cc75cf8fda97458d56f30f1e.tar.bz2
trackermap-web-2fde351d087141a0cc75cf8fda97458d56f30f1e.zip
Check for position (fix #974)
Diffstat (limited to 'modern/src')
-rw-r--r--modern/src/main/StatusCard.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/modern/src/main/StatusCard.js b/modern/src/main/StatusCard.js
index b9237103..b42f9f3a 100644
--- a/modern/src/main/StatusCard.js
+++ b/modern/src/main/StatusCard.js
@@ -183,12 +183,14 @@ const StatusCard = ({ deviceId, onClose }) => {
</CardActions>
</Card>
)}
- <Menu anchorEl={anchorEl} open={Boolean(anchorEl)} onClose={() => setAnchorEl(null)}>
- <MenuItem onClick={() => navigate(`/position/${position.id}`)}><Typography color="secondary">{t('sharedShowDetails')}</Typography></MenuItem>
- <MenuItem component="a" target="_blank" href={`https://www.google.com/maps/search/?api=1&query=${position.latitude}%2C${position.longitude}`}>{t('linkGoogleMaps')}</MenuItem>
- <MenuItem component="a" target="_blank" href={`http://maps.apple.com/?ll=${position.latitude},${position.longitude}`}>{t('linkAppleMaps')}</MenuItem>
- <MenuItem component="a" target="_blank" href={`https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=${position.latitude}%2C${position.longitude}`}>{t('linkStreetView')}</MenuItem>
- </Menu>
+ {position && (
+ <Menu anchorEl={anchorEl} open={Boolean(anchorEl)} onClose={() => setAnchorEl(null)}>
+ <MenuItem onClick={() => navigate(`/position/${position.id}`)}><Typography color="secondary">{t('sharedShowDetails')}</Typography></MenuItem>
+ <MenuItem component="a" target="_blank" href={`https://www.google.com/maps/search/?api=1&query=${position.latitude}%2C${position.longitude}`}>{t('linkGoogleMaps')}</MenuItem>
+ <MenuItem component="a" target="_blank" href={`http://maps.apple.com/?ll=${position.latitude},${position.longitude}`}>{t('linkAppleMaps')}</MenuItem>
+ <MenuItem component="a" target="_blank" href={`https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=${position.latitude}%2C${position.longitude}`}>{t('linkStreetView')}</MenuItem>
+ </Menu>
+ )}
<RemoveDialog
open={removing}
endpoint="devices"