How To Activate Break in Pomodoro

Good evening,

This is my code for timer functionality, and although the session time works, it seems that it never goes on break from some reason. Here is the code:

  useEffect(() => {
    let interval = setInterval(() => {
      clearInterval(interval);
      //BEGINNING OF SESSION HANDLER
      if (!breakStarts && sessionSeconds === 0) { //session is ongoing and seconds reached 0
        if (sessionMinutes !== 0) {//session is ongoing, seconds reached 0, and session is not over  
          setSessionSeconds(59); 
          setSessionMinutes(sessionMinutes - 1); 
        } else { //session is ongoing, seconds reached 0, and session is over 
          setBreakStarts(true) //this makes the timer focus on the break timer 
        }
      } else if (!breakStarts && sessionSeconds !== 0) {
        setSessionSeconds(sessionSeconds - 1)
      }
      //END OF SESSION HANDLER
      
      //BEGINNING OF BREAK HANDLER

      if (breakStarts && breakSeconds === 0) { //break is ongoing and seconds reached 0
        if (breakMinutes !== 0) {//break is ongoing, seconds reached 0, and break is not over  
          setBreakSeconds(59); 
          setBreakMinutes(breakMinutes - 1); 
        } else { //break is ongoing, seconds reached 0, and break is over 
          setBreakStarts(false) //this makes the timer focus on the session timer 
        }
      } else if (breakStarts && breakSeconds !== 0) {
        setBreakSeconds(breakSeconds - 1)
      }

      //END OF BREAK HANDLER
    
    }, 1000);
  }, [breakStarts ? breakSeconds : sessionSeconds]); //if there's a break going on, use breakSeconds as reference, and if not, use sessionSeconds