From 396d62543762354efa1bd6515f9e970915835c18 Mon Sep 17 00:00:00 2001 From: nuttylmao Date: Fri, 9 May 2025 19:16:11 +1000 Subject: [PATCH] Fixed bug where alerts would get "queued up" when the tab is inactive. --- multistream-alerts/script.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/multistream-alerts/script.js b/multistream-alerts/script.js index d469cc6..91845af 100644 --- a/multistream-alerts/script.js +++ b/multistream-alerts/script.js @@ -1191,6 +1191,14 @@ function GetWinnersList(gifts) { } function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attributeText, username, message, sbAction, sbData) { + // If the page is inactive (e.g. the alert browser source is on an inactive OBS scene) + // don't run the alert + if (document.visibilityState != 'visible') + { + console.debug('Tab is inactive. Skipping alert...'); + return; + } + // Check if the widget is in the middle of an animation // If any alerts are requested while the animation is playing, it should be added to the alert queue if (widgetLocked) {