From 813fd36b0acc8dcce04c306facca7b3bd72cc9e3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 25 Feb 2022 14:13:18 -0500 Subject: [PATCH] clearInterval when location.replacing so that timer stops. Prevents infinite loop --- web/skins/classic/views/js/watch.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 4af160389..2a2d1d8d5 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -965,6 +965,7 @@ var secondsToCycle = 0; function nextCycleView() { secondsToCycle --; if (secondsToCycle<=0) { + secondsToCycle = 0; window.location.replace('?view=watch&mid='+nextMid+'&mode='+mode+'&cycle=true'); } $j('#secondsToCycle').text(secondsToCycle); @@ -991,6 +992,7 @@ function cycleNext() { if (!monitorData[monIdx]) { console.log('No monitorData for ' + monIdx); } + clearInterval(intervalId); window.location.replace('?view=watch&cycle=true&mid='+monitorData[monIdx].id+'&mode='+mode); } @@ -1002,6 +1004,7 @@ function cyclePrev() { if (!monitorData[monIdx]) { console.log('No monitorData for ' + monIdx); } + clearInterval(intervalId); window.location.replace('?view=watch&cycle=true&mid='+monitorData[monIdx].id+'&mode='+mode); }