Fixed bug where alerts would get "queued up" when the tab is inactive.

This commit is contained in:
nuttylmao
2025-05-09 19:16:11 +10:00
parent 3f55e3d2fb
commit 396d625437
+8
View File
@@ -1191,6 +1191,14 @@ function GetWinnersList(gifts) {
} }
function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attributeText, username, message, sbAction, sbData) { 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 // 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 any alerts are requested while the animation is playing, it should be added to the alert queue
if (widgetLocked) { if (widgetLocked) {