fix: remove ununsed return statements in keyhandler()

This commit is contained in:
Sebastian Mark 2024-10-27 11:12:38 +01:00
parent bbc9977f1c
commit 4f9bd664a3
2 changed files with 1 additions and 6 deletions

View file

@ -20,23 +20,19 @@ func keyhandler(conn *ws.Conn, config ChronoTomato.Config, message *GoTomato.Ser
case "space": case "space":
if !message.Ongoing { if !message.Ongoing {
websocket.SendCmd(conn, config.Password, "start") websocket.SendCmd(conn, config.Password, "start")
return false, nil break
} }
if message.Paused { if message.Paused {
websocket.SendCmd(conn, config.Password, "resume") websocket.SendCmd(conn, config.Password, "resume")
return false, nil
} else { } else {
websocket.SendCmd(conn, config.Password, "pause") websocket.SendCmd(conn, config.Password, "pause")
return false, nil
} }
case "s": case "s":
websocket.SendCmd(conn, config.Password, "stop") websocket.SendCmd(conn, config.Password, "stop")
return false, nil
case "r": case "r":
if config.PomodoroConfig != (GoTomato.GoTomatoPomodoroConfig{}) { if config.PomodoroConfig != (GoTomato.GoTomatoPomodoroConfig{}) {
websocket.Send_updateSettings(conn, config.Password, config.PomodoroConfig) websocket.Send_updateSettings(conn, config.Password, config.PomodoroConfig)
} }
return false, nil
case "q": case "q":
quit <- true quit <- true
return true, nil return true, nil

View file

@ -9,7 +9,6 @@ import (
func sendClientCommand(conn *websocket.Conn, msg GoTomato.ClientCommand) { func sendClientCommand(conn *websocket.Conn, msg GoTomato.ClientCommand) {
messageBytes, err := json.Marshal(msg) messageBytes, err := json.Marshal(msg)
if err != nil { if err != nil {
log.Error("Error marshalling!", "reason", err) log.Error("Error marshalling!", "reason", err)
return return