From b6a49bef00b501594c59d6329c35b49851ac654c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 6 Nov 2024 16:43:16 -0500 Subject: [PATCH] Fix stream getting killed after visibility returns if we return before 15 seconds --- web/skins/classic/views/js/watch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index a602e00e57..257a24b8bf 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -1431,8 +1431,9 @@ function monitorsSetScale(id=null) { $j( window ).on("load", initPage); document.onvisibilitychange = () => { + // Always clear it because the return to visibility might happen before timeout + TimerHideShow = clearTimeout(TimerHideShow); if (document.visibilityState === "hidden") { - TimerHideShow = clearTimeout(TimerHideShow); TimerHideShow = setTimeout(function() { //Stop monitor when closing or hiding page if (monitorStream) {