Pomodoro Clock issue with delay in timer

Pomodoro Clock issue with delay in timer
0

#1

Hey guys,

Basically when the work clock runs down and switches to the break clock, the minute digit runs a negative digit just for a brief second before switching to the proper countdown. I noticed there is also a slight delay in the negative digit as well. I think it has to do with the “if” statements on lines 63 and 90. Any help would be appreciated. I’ve been racking my brain for hours on this issue!


#2

your problem is this condition

		if (secs === 59) {
			mins--;
			minutes.textContent = mins;
		}

It reduce mins by 1 every time secs hits 59 even if mins value is 0
i changed it to this and now it works

		if (secs === 59 && mins > 0) {
    mins--;
			minutes.textContent = mins;
    
		}else if(secs === 59 && mins <= 0){
    minutes.textContent = initialBreak-1;
    mins = initialBreak
  }

#3

wow, thanks @elad! That solved the issue. I appreciate your help.