From c49db38ad844ff7328be391cc3526a880b3aca66 Mon Sep 17 00:00:00 2001 From: nuttylmao Date: Thu, 8 May 2025 03:28:16 +1000 Subject: [PATCH] Fixed bug where the alert box would try to show a message even if there was none --- multistream-alerts/script.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multistream-alerts/script.js b/multistream-alerts/script.js index 86d6f59..4ee2430 100644 --- a/multistream-alerts/script.js +++ b/multistream-alerts/script.js @@ -1267,7 +1267,13 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib alertBox.style.transition = 'all 0.5s ease-in-out'; theContentThatShowsFirstInsteadOfSecond.style.opacity = 0; - if (message && showMesesages) { + // For safety, if message doesn't exist, set it to empty string anyway + if (!message) + message = ''; + + // If there is a message, show it in the second part of the animation + // Else, just close the alert box and run the next alert + if (message.trim().length > 0 && showMesesages) { //theContentThatShowsLastInsteadOfFirst.style.display = 'inline-block'; theContentThatShowsLastInsteadOfFirst.style.visibility = 'visible';