summaryrefslogtreecommitdiff
path: root/pkg/ui/views/play.go
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-04-18 21:25:32 +0200
committerSanto Cariotti <santo@dcariotti.me>2025-04-18 21:25:32 +0200
commit42d68aa99d59339dbdf928a54c28242635728daa (patch)
tree98dadfd64a0fc05d1fb6f6ddbc9a3e8963fbf1dd /pkg/ui/views/play.go
parent7c5a6176b27b6b0c0c3ef8a4aedbdec871391a80 (diff)
Restore a game
Diffstat (limited to 'pkg/ui/views/play.go')
-rw-r--r--pkg/ui/views/play.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/ui/views/play.go b/pkg/ui/views/play.go
index 20e2ebb..3d75a90 100644
--- a/pkg/ui/views/play.go
+++ b/pkg/ui/views/play.go
@@ -46,6 +46,7 @@ type PlayModel struct {
game *database.Game
network *multiplayer.GameNetwork
games []database.Game
+ gameToRestore *database.Game
}
// NewPlayModel creates a new play model instance
@@ -89,7 +90,7 @@ func (m PlayModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.userID, m.err = getUserID()
return m.handleGamesResponse(msg)
case StartGameMsg:
- return m, SwitchModelCmd(NewGameModel(m.width, m.height+1, m.currentGameId, m.network))
+ return m, SwitchModelCmd(NewGameModel(m.width, m.height+1, m.currentGameId, m.network, m.gameToRestore != nil))
case error:
return m.handleError(msg)
}