Hi there, I am having issue with timer logic on Pomodoro Project.
When it goes through the condition first time state is updated and new time for break session is starting, but it does not switch back.
Any help is appreciated.
My code is here
https://codepen.io/vecherstvo/pen/rNOOxWa?editors=0010
timer() {
if (this.state.secCount === 56) {
if (this.state.timerLabel == "session") {
this.setState({
secCount: this.state.breakLengthSec - 1,
timerLabel: "break"
});
}
} else if (this.state.secCount === 56) {
if (this.state.timerLabel == "break") {
this.setState({
secCount: this.state.count - 1,
timerLabel: "session"
});
}
} else if (this.state.secCount > 56) {
this.setState({
secCount: this.state.secCount - 1
});
}
}
PS I set 56 instead of 0 for testing purposes to save waiting time.
Thank you