diff --git a/internal/websocket/client_commands.go b/internal/websocket/client_commands.go index 88535e4..d5c953b 100644 --- a/internal/websocket/client_commands.go +++ b/internal/websocket/client_commands.go @@ -49,9 +49,9 @@ func handleClientCommands(ws *websocket.Conn) { } case "updateSettings": if !pomodoro.IsPomodoroOngoing() { - if clientCommand.PomodoroSettings != (models.GoTomatoPomodoroConfig{}) { - shared.Message.Settings = clientCommand.PomodoroSettings - shared.Message.TimeLeft = clientCommand.PomodoroSettings.Work + if clientCommand.Settings != (models.GoTomatoPomodoroConfig{}) { + shared.Message.Settings = clientCommand.Settings + shared.Message.TimeLeft = clientCommand.Settings.Work } } diff --git a/pkg/models/client.go b/pkg/models/client.go index 6862cb1..34b6455 100644 --- a/pkg/models/client.go +++ b/pkg/models/client.go @@ -8,9 +8,9 @@ import ( // ClientCommand represents a command from the client (start/stop). type ClientCommand struct { - Command string `json:"command"` // comman send to the server - Password string `json:"password"` // pomodoro control password - PomodoroSettings GoTomatoPomodoroConfig `json:"settings"` // pomodoro config + Command string `json:"command"` // comman send to the server + Password string `json:"password"` // pomodoro control password + Settings GoTomatoPomodoroConfig `json:"settings"` // pomodoro config } type Client struct {