diff --git a/cmd/client/main.go b/cmd/client/main.go index 9184598..63da593 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -38,13 +38,9 @@ func Start() { conn := websocket.Connect(url) - if config.PomodoroConfig != (models.GoTomatoPomodoroConfig{}) { - websocket.Send_updateSettings(conn, config.Password, config.PomodoroConfig) - } - go websocket.ProcessServerMessages(conn) - pomodoro := &shared.ServerMessage + pomodoro := &shared.ServerMessage keyboard.Listen(func(key keys.Key) (stop bool, err error) { switch key.String() { case "space": @@ -59,9 +55,15 @@ func Start() { websocket.SendCmd(conn, password, "pause") return false, nil } - case "r": + case "s": websocket.SendCmd(conn, password, "stop") return false, nil + case "r": + + if config.PomodoroConfig != (models.GoTomatoPomodoroConfig{}) { + websocket.Send_updateSettings(conn, password, config.PomodoroConfig) + } + return false, nil case "q": interrupt <- os.Interrupt return true, nil diff --git a/internal/notifications/terminal.go b/internal/notifications/terminal.go index 3731435..685cf79 100644 --- a/internal/notifications/terminal.go +++ b/internal/notifications/terminal.go @@ -43,5 +43,5 @@ func TerminalOutput() { //footer fmt.Printf(strings.Repeat("\n", 3)) - color.White("space: start/pause/resume • r: stop • q: quit") + color.White("space: start/pause/resume • s: stop • r: reset pomodoro • q: quit") }