I have a timer running in my app and i also have a part where i warn the user about something using a confirm dialog pop up. I noticed my timer script pauses any time the confirm box pops up and continues when the confirm box goes off.
Here is my timer script;
startCountDown(seconds){
this.counter = seconds;
this.interval = setInterval(() => {
this.remainingTime = this.counter;
this.counter--;
if (this.counter < 0 ) {
clearInterval(this.interval);
}
}, 1000);
}
If a confirm box is called like this:
if ( confirm("Do you wish to continue") )
the script pauses and continues when the confirm box goes away. I am aware this is the normal way it should function but i was thinking there would be a way to prevent the pop up from pausing the timer script. Any help would be appreciated. Thanks.