feat: update variable and function name for started pomodoro

- change variable name from pomodoroRunning to pomodoroOngoing
- update function name from IsPomodoroRunning to IsPomodoroOngoing
- modify client command checks to use IsPomodoroActive instead of IsPomodoroRunning

🤖
This commit is contained in:
Sebastian Mark 2024-10-20 18:08:12 +02:00
parent b71d04aad2
commit b46d2469d3
2 changed files with 10 additions and 10 deletions

View file

@ -34,19 +34,19 @@ func handleClientCommands(ws *websocket.Conn) {
// Process the command
switch command.Command {
case "start":
if !pomodoro.IsPomodoroRunning() {
if !pomodoro.IsPomodoroOngoing() {
go pomodoro.RunPomodoroTimer(Clients) // Start the timer with the list of clients
}
case "stop":
if pomodoro.IsPomodoroRunning() {
if pomodoro.IsPomodoroOngoing() {
pomodoro.ResetPomodoro(Clients) // Reset Pomodoro
}
case "pause":
if pomodoro.IsPomodoroRunning() && !pomodoro.IsPomodoroPaused() {
if pomodoro.IsPomodoroOngoing() && !pomodoro.IsPomodoroPaused() {
pomodoro.PausePomodoro() // Pause the timer
}
case "resume":
if pomodoro.IsPomodoroRunning() && pomodoro.IsPomodoroPaused() {
if pomodoro.IsPomodoroOngoing() && pomodoro.IsPomodoroPaused() {
pomodoro.ResumePomodoro() // Resume the timer
}
}