From f1bb00ad6f490b667e5f0e2b84a74fe6bd710d9b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 15 May 2022 16:30:03 -0700 Subject: Fix replay issues --- modern/src/other/ReplayPage.js | 5 +++-- 1 file 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} />
- {`${index}/${positions.length}`} + {`${index + 1}/${positions.length}`} setIndex((index) => index - 1)} disabled={playing}> -- cgit v1.2.3