aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-15 16:30:03 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-15 16:30:03 -0700
commitf1bb00ad6f490b667e5f0e2b84a74fe6bd710d9b (patch)
tree2dfe929e076815694af9230317a98adba1719d76 /modern
parent18bf43634ba99e8a77571b6bcf650f4687c6df68 (diff)
downloadtrackermap-web-f1bb00ad6f490b667e5f0e2b84a74fe6bd710d9b.tar.gz
trackermap-web-f1bb00ad6f490b667e5f0e2b84a74fe6bd710d9b.tar.bz2
trackermap-web-f1bb00ad6f490b667e5f0e2b84a74fe6bd710d9b.zip
Fix replay issues
Diffstat (limited to 'modern')
-rw-r--r--modern/src/other/ReplayPage.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/modern/src/other/ReplayPage.js b/modern/src/other/ReplayPage.js
index 1fddc21c..9bdf87be 100644
--- a/modern/src/other/ReplayPage.js
+++ b/modern/src/other/ReplayPage.js
@@ -115,8 +115,9 @@ const ReplayPage = () => {
}, [playing, positions]);
useEffect(() => {
- if (index >= positions.length) {
+ if (index >= positions.length - 1) {
clearInterval(timerRef.current);
+ setPlaying(false);
}
}, [index, positions]);
@@ -171,7 +172,7 @@ const ReplayPage = () => {
ValueLabelComponent={TimeLabel}
/>
<div className={classes.controls}>
- {`${index}/${positions.length}`}
+ {`${index + 1}/${positions.length}`}
<IconButton onClick={() => setIndex((index) => index - 1)} disabled={playing}>
<FastRewindIcon />
</IconButton>