chore: reorder parameters in SendCmd function
🤖
This commit is contained in:
parent
e1984aca10
commit
a61da7d280
2 changed files with 6 additions and 6 deletions
|
@ -25,7 +25,7 @@ func Start() {
|
||||||
|
|
||||||
websocket.Send_updateSettings(conn, *password)
|
websocket.Send_updateSettings(conn, *password)
|
||||||
if *autoStart {
|
if *autoStart {
|
||||||
websocket.SendCmd(conn, "start", *password)
|
websocket.SendCmd(conn, *password, "start")
|
||||||
}
|
}
|
||||||
|
|
||||||
go websocket.ProcessServerMessages(conn)
|
go websocket.ProcessServerMessages(conn)
|
||||||
|
@ -34,18 +34,18 @@ func Start() {
|
||||||
switch key.String() {
|
switch key.String() {
|
||||||
case "space":
|
case "space":
|
||||||
if !shared.ServerMessage.Ongoing {
|
if !shared.ServerMessage.Ongoing {
|
||||||
websocket.SendCmd(conn, "start", *password)
|
websocket.SendCmd(conn, *password, "start")
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
if shared.ServerMessage.Paused {
|
if shared.ServerMessage.Paused {
|
||||||
websocket.SendCmd(conn, "resume", *password)
|
websocket.SendCmd(conn, *password, "resume")
|
||||||
return false, nil
|
return false, nil
|
||||||
} else {
|
} else {
|
||||||
websocket.SendCmd(conn, "pause", *password)
|
websocket.SendCmd(conn, *password, "pause")
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
case "r":
|
case "r":
|
||||||
websocket.SendCmd(conn, "stop", *password)
|
websocket.SendCmd(conn, *password, "stop")
|
||||||
return false, nil
|
return false, nil
|
||||||
case "q":
|
case "q":
|
||||||
interrupt <- os.Interrupt
|
interrupt <- os.Interrupt
|
||||||
|
|
|
@ -23,7 +23,7 @@ func sendClientCommand(conn *websocket.Conn, msg models.ClientCommand) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendCmd(conn *websocket.Conn, cmd string, pwd string) {
|
func SendCmd(conn *websocket.Conn, pwd string, cmd string) {
|
||||||
message := models.ClientCommand{
|
message := models.ClientCommand{
|
||||||
Command: cmd,
|
Command: cmd,
|
||||||
Password: pwd,
|
Password: pwd,
|
||||||
|
|
Loading…
Reference in a new issue