Pomodoro clock not switching properly

Hey guys ,
I have a problem with the pomodoro clock .
If I start the first time and my session timer reaches zero it will switch to the break timer but if my break timer reaches zero it just starts the break timer again .
If i click start/pause twice it will switch back again when it reaches zero.
I have been searching for this for two days now and I have no idea what is causing this …
For some reason I can’t get my code to work on codepen but here is a link to my github repo . https://github.com/JevF1982/Pomodoro_Clock.

I use context API and react hooks in my app.

thanks in advance

I found the solution .
I had to put my start and clear Interval in a useEffect hook and call it if my timer would reach zero .