aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2022-02-16 11:12:50 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2022-02-16 11:12:50 +0530
commit6fb781e1b48e8c329cae56248fae0cef4f6167d8 (patch)
tree9a83103a578d1c206d13aab2f082a42a2191c393 /modern
parentcce4095ecacc265882317b71f505cdd36c3e4a7c (diff)
downloadtrackermap-web-6fb781e1b48e8c329cae56248fae0cef4f6167d8.tar.gz
trackermap-web-6fb781e1b48e8c329cae56248fae0cef4f6167d8.tar.bz2
trackermap-web-6fb781e1b48e8c329cae56248fae0cef4f6167d8.zip
minor issues fixes in
Diffstat (limited to 'modern')
-rw-r--r--modern/src/reports/ReplayPage.js9
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"
/>