Start count down only if there is something to count down

This commit is contained in:
DL6ER
2017-03-01 14:12:13 +01:00
parent e310acdb4b
commit 7729eea48d

View File

@@ -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;