aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-27 07:08:05 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-27 07:08:05 -0700
commit32cb5f8d90df09fd45a54c96491bc3568f14690b (patch)
tree051737496874057755ef728b523a203a6b861b87 /modern/src/map
parentfa83492234ba77ae3599ce67217c25122d19f361 (diff)
downloadtrackermap-web-32cb5f8d90df09fd45a54c96491bc3568f14690b.tar.gz
trackermap-web-32cb5f8d90df09fd45a54c96491bc3568f14690b.tar.bz2
trackermap-web-32cb5f8d90df09fd45a54c96491bc3568f14690b.zip
Fix browser support
Diffstat (limited to 'modern/src/map')
-rw-r--r--modern/src/map/main/MapLiveRoutes.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/modern/src/map/main/MapLiveRoutes.js b/modern/src/map/main/MapLiveRoutes.js
index 6e79d7af..139f7d65 100644
--- a/modern/src/map/main/MapLiveRoutes.js
+++ b/modern/src/map/main/MapLiveRoutes.js
@@ -57,7 +57,7 @@ const MapLiveRoutes = () => {
setRoute([position]);
}
} else if (position) {
- const last = route.at(-1);
+ const last = route.findLast(() => true);
if (!last || (last.latitude !== position.latitude && last.longitude !== position.longitude)) {
setRoute([...route.slice(-9), position]);
}