fix: resolve race condition in pause/resume check

- replace direct check of pomodoroPaused with IsPomodoroPaused function
This commit is contained in:
Sebastian Mark 2024-10-20 11:26:23 +02:00
parent 4471c86a0c
commit b62e92b5a4

View file

@ -23,7 +23,7 @@ func startTimer(clients map[*websocket.Conn]*models.Client, remainingSeconds int
mu.Unlock() mu.Unlock()
default: default:
// Broadcast the current state to all clients // Broadcast the current state to all clients
if !pomodoroPaused { if !IsPomodoroPaused() {
broadcast.BroadcastMessage(clients, models.BroadcastMessage{ broadcast.BroadcastMessage(clients, models.BroadcastMessage{
Mode: mode, Mode: mode,
Session: session, Session: session,