diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-15 16:30:03 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-15 16:30:03 -0700 |
commit | f1bb00ad6f490b667e5f0e2b84a74fe6bd710d9b (patch) | |
tree | 2dfe929e076815694af9230317a98adba1719d76 /modern/src/other/ReplayPage.js | |
parent | 18bf43634ba99e8a77571b6bcf650f4687c6df68 (diff) | |
download | trackermap-web-f1bb00ad6f490b667e5f0e2b84a74fe6bd710d9b.tar.gz trackermap-web-f1bb00ad6f490b667e5f0e2b84a74fe6bd710d9b.tar.bz2 trackermap-web-f1bb00ad6f490b667e5f0e2b84a74fe6bd710d9b.zip |
Fix replay issues
Diffstat (limited to 'modern/src/other/ReplayPage.js')
-rw-r--r-- | modern/src/other/ReplayPage.js | 5 |
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> |