diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2022-02-16 11:12:50 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2022-02-16 11:12:50 +0530 |
commit | 6fb781e1b48e8c329cae56248fae0cef4f6167d8 (patch) | |
tree | 9a83103a578d1c206d13aab2f082a42a2191c393 /modern/src | |
parent | cce4095ecacc265882317b71f505cdd36c3e4a7c (diff) | |
download | trackermap-web-6fb781e1b48e8c329cae56248fae0cef4f6167d8.tar.gz trackermap-web-6fb781e1b48e8c329cae56248fae0cef4f6167d8.tar.bz2 trackermap-web-6fb781e1b48e8c329cae56248fae0cef4f6167d8.zip |
minor issues fixes in
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/reports/ReplayPage.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modern/src/reports/ReplayPage.js b/modern/src/reports/ReplayPage.js index d3839c5c..d79e19ce 100644 --- a/modern/src/reports/ReplayPage.js +++ b/modern/src/reports/ReplayPage.js @@ -86,6 +86,7 @@ const ReplayPage = () => { useEffect(() => { if (isPlaying && positions.length > 0) { timerRef.current = setInterval(() => { + console.log('in setInterval func'); setIndex((index) => index + 1); }, 500); } else { @@ -95,6 +96,12 @@ const ReplayPage = () => { return () => clearInterval(timerRef.current); }, [isPlaying, positions]); + useEffect(() => { + if (index >= positions.length) { + clearInterval(timerRef.current); + } + }, [index]); + const handleSubmit = async (deviceId, from, to, _, headers) => { setSelectedDeviceId(deviceId); const query = new URLSearchParams({ deviceId, from, to }); @@ -187,7 +194,6 @@ const ReplayPage = () => { <TextField fullWidth label={t('reportPlaybackPerMinute')} - name="playbackpermin" value={playbackSpeed} onChange={(e) => setPlaybackSpeed(e.target.value)} variant="filled" @@ -200,7 +206,6 @@ const ReplayPage = () => { <Switch checked={isPlaying} onChange={(e) => setIsPlaying(e.target.checked)} - name="autoPlay" color="primary" edge="start" /> |