feat: add pause and resume functionality
- implement pause and resume commands in the Pomodoro package
- modify timer logic to handle paused state
- adjust client command handling for pause and resume actions
- update HTML to include pause/resume button
🤖
This commit is contained in:
parent
c9501c3bbb
commit
bc3a306c00
4 changed files with 94 additions and 22 deletions
|
@ -34,8 +34,17 @@ func handleClientCommands(ws *websocket.Conn) {
|
|||
}
|
||||
case "stop":
|
||||
if pomodoro.IsPomodoroRunning() {
|
||||
pomodoro.StopTimer() // Stop the timer in the Pomodoro package
|
||||
pomodoro.StopPomodoro() // Stop the timer in the Pomodoro package
|
||||
}
|
||||
case "pause":
|
||||
if pomodoro.IsPomodoroRunning() && !pomodoro.IsPomodoroPaused() {
|
||||
pomodoro.PausePomodoro() // Pause the timer
|
||||
}
|
||||
case "resume":
|
||||
if pomodoro.IsPomodoroRunning() && pomodoro.IsPomodoroPaused() {
|
||||
pomodoro.ResumePomodoro() // Resume the timer
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue