Avoid optional chaining in non-transpiled webhook code. Use getElementById instead of queryselectorall for the single id fetch.

This commit is contained in:
Dannon Baker
2023-07-28 08:44:13 -04:00
parent 0f9b1c1730
commit f85b8d1be9
+4 -2
View File
@@ -8,8 +8,10 @@
function newsSeen(currentGalaxyVersion) {
// When it's seen, remove the red indicator if it exists and store the current version.
const newsIndicator = document.querySelector("#news-indicator");
newsIndicator?.remove();
const newsIndicator = document.getElementById("news-indicator");
if (newsIndicator) {
newsIndicator.remove();
}
window.localStorage.setItem("galaxy-news-seen-release", currentGalaxyVersion);
}