diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index cd9ffa21..fb398637 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -655,10 +655,14 @@ function updateSummaryData(runOnce) { } ["ads_blocked_today", "dns_queries_today", "ads_percentage_today", "unique_clients"].forEach(function(today) { - var todayElement = $("span#" + today); - todayElement.text() !== data[today] && - todayElement.text() !== data[today] + "%" && - $("span#" + today).addClass("glow"); + var $todayElement = $("span#" + today); + + if ( + $todayElement.text() !== data[today] && + $todayElement.text() !== data[today] + "%" + ) { + $todayElement.addClass("glow"); + } }); if(Object.prototype.hasOwnProperty.call(data, "dns_queries_all_types"))