mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:24:36 +02:00
stop the refresh countdown once we hit zero
This commit is contained in:
parent
80f1594a17
commit
2a7626159c
1 changed files with 2 additions and 1 deletions
|
@ -193,13 +193,14 @@ function showRestartModal() {
|
||||||
refreshSpan.html(numberOfSecondsToWait + " seconds");
|
refreshSpan.html(numberOfSecondsToWait + " seconds");
|
||||||
|
|
||||||
// call ourselves every 1 second to countdown
|
// call ourselves every 1 second to countdown
|
||||||
window.setInterval(function(){
|
var refreshCountdown = setInterval(function(){
|
||||||
secondsElapsed++;
|
secondsElapsed++;
|
||||||
secondsLeft = numberOfSecondsToWait - secondsElapsed
|
secondsLeft = numberOfSecondsToWait - secondsElapsed
|
||||||
refreshSpan.html(secondsLeft + (secondsLeft == 1 ? " second" : " seconds"))
|
refreshSpan.html(secondsLeft + (secondsLeft == 1 ? " second" : " seconds"))
|
||||||
|
|
||||||
if (secondsElapsed == numberOfSecondsToWait) {
|
if (secondsElapsed == numberOfSecondsToWait) {
|
||||||
location.reload(true);
|
location.reload(true);
|
||||||
|
clearInterval(refreshCountdown);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue