diff --git a/internal/websocket/receive.go b/internal/websocket/receive.go index 4aeb6ad..e4638a6 100644 --- a/internal/websocket/receive.go +++ b/internal/websocket/receive.go @@ -29,8 +29,14 @@ func (c *Client) ProcessServerMessages(channel chan<- GoTomato.ServerMessage) { // Try to reconnect on unexpected disconnect for { channel <- prevMessage // send previous ServerMessage to update view + time.Sleep(time.Second) + + // reconnect while preserving password + pw := c.Password *c = Connect(c.Server) + c.Password = pw + if c.Connected() { break }