From 2174eaa83698336d41d04a10b86e42c1dfa24825 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 29 Jun 2024 09:29:10 +0200 Subject: [PATCH] Update summary data with new count Signed-off-by: DL6ER --- scripts/pi-hole/js/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index df8d36b6b..1848f1db0 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -399,9 +399,6 @@ function updateSummaryData(runOnce = false) { $.getJSON("/api/stats/summary", function (data) { var intl = new Intl.NumberFormat(); const newCount = parseInt(data.queries.total, 10); - if (previousCount === 0) { - previousCount = newCount; - } $("span#dns_queries").text(intl.format(newCount)); $("span#active_clients").text(intl.format(parseInt(data.clients.active, 10))); @@ -422,6 +419,8 @@ function updateSummaryData(runOnce = false) { updateForwardDestinationsPie(); updateTopLists(); } + + previousCount = newCount; }) .done(function () { if (!runOnce) utils.setTimer(updateSummaryData, REFRESH_INTERVAL.summary);