From c6bcea5a8c944dc91efa7f2e47c110d009d26d0a Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 5 Jan 2022 08:49:55 -0500 Subject: [PATCH] For gtn/news frames, ensure frame is engaged prior to dismissal. Guarding here is simpler than tracking event handlers and making assumptions. --- config/plugins/webhooks/gtn/script.js | 5 ++++- config/plugins/webhooks/news/script.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/plugins/webhooks/gtn/script.js b/config/plugins/webhooks/gtn/script.js index d9310df39b9..77f1b1e9f5a 100644 --- a/config/plugins/webhooks/gtn/script.js +++ b/config/plugins/webhooks/gtn/script.js @@ -3,7 +3,10 @@ var lastUpdate = 0; function removeOverlay() { - document.getElementById("gtn-container").style.visibility = "hidden"; + const container = document.getElementById("gtn-container"); + if (container) { + container.style.visibility = "hidden"; + } } function showOverlay() { diff --git a/config/plugins/webhooks/news/script.js b/config/plugins/webhooks/news/script.js index 93cff81017b..688de22d74e 100644 --- a/config/plugins/webhooks/news/script.js +++ b/config/plugins/webhooks/news/script.js @@ -1,6 +1,9 @@ (function () { function hideNewsOverlay() { - document.getElementById("news-container").style.visibility = "hidden"; + const container = document.getElementById("news-container"); + if (container) { + container.style.visibility = "hidden"; + } } function newsSeen() {