mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Stop timer when user reenabled blocking early
Signed-off-by: Fabian Preuß <preuss_fabian@gmx.de>
This commit is contained in:
@@ -46,6 +46,11 @@ function countDown() {
|
||||
var target = new Date(parseInt(enaT.html(), 10));
|
||||
var seconds = Math.round((target.getTime() - Date.now()) / 1000);
|
||||
|
||||
//Stop and remove timer when user enabled early
|
||||
if ($("#pihole-enable").is(":hidden")) {
|
||||
ena.text("Enable");
|
||||
return;
|
||||
}
|
||||
if (seconds > 0) {
|
||||
setTimeout(countDown, 1000);
|
||||
ena.text("Enable (" + secondsTimeSpanToHMS(seconds) + ")");
|
||||
|
||||
Reference in New Issue
Block a user