From 7729eea48da2a9a383b52b0107acbfa7129b6420 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 1 Mar 2017 14:12:13 +0100 Subject: [PATCH] Start count down only if there is something to count down --- scripts/pi-hole/js/footer.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index 219ea51d..20866b85 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -91,8 +91,11 @@ function piholeChange(action, duration) if(data.status === "disabled") { btnStatus.html(""); piholeChanged("disabled"); - enaT.html(new Date().getTime() + duration * 1000); - setTimeout(countDown,100); + if(duration > 0) + { + enaT.html(new Date().getTime() + duration * 1000); + setTimeout(countDown,100); + } } }); break;