refactor: move broadcast.Message to shared.Message
- create a new shared state file to manage message state
- replace broadcast.Message with shared.Message in pomodoro logic
- update websocket client handling to use shared.Clients
- remove unnecessary broadcast imports from various files
- ensure consistent message handling across the application
🤖
This commit is contained in:
parent
234f3c17dc
commit
aab6896c7d
6 changed files with 44 additions and 40 deletions
|
@ -2,7 +2,6 @@ package websocket
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.smsvc.net/pomodoro/GoTomato/internal/broadcast"
|
||||
"git.smsvc.net/pomodoro/GoTomato/internal/pomodoro"
|
||||
"git.smsvc.net/pomodoro/GoTomato/pkg/models"
|
||||
"github.com/gorilla/websocket"
|
||||
|
@ -25,7 +24,7 @@ func handleClientCommands(ws *websocket.Conn) {
|
|||
_, message, err := ws.ReadMessage()
|
||||
if err != nil {
|
||||
log.Printf("Client disconnected: %v", err)
|
||||
delete(broadcast.Clients, ws)
|
||||
delete(Clients, ws)
|
||||
break
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue