Skip to content

Commit

Permalink
Fix stream getting killed after visibility returns if we return befor…
Browse files Browse the repository at this point in the history
…e 15 seconds
  • Loading branch information
Isaac Connor committed Nov 6, 2024
1 parent 15733c2 commit b6a49be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/skins/classic/views/js/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b6a49be

Please sign in to comment.