mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45: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");
|
||||
|
||||
// call ourselves every 1 second to countdown
|
||||
window.setInterval(function(){
|
||||
var refreshCountdown = setInterval(function(){
|
||||
secondsElapsed++;
|
||||
secondsLeft = numberOfSecondsToWait - secondsElapsed
|
||||
refreshSpan.html(secondsLeft + (secondsLeft == 1 ? " second" : " seconds"))
|
||||
|
||||
if (secondsElapsed == numberOfSecondsToWait) {
|
||||
location.reload(true);
|
||||
clearInterval(refreshCountdown);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue