diff options
Diffstat (limited to 'pkg/ui/views/game.go')
-rw-r--r-- | pkg/ui/views/game.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/pkg/ui/views/game.go b/pkg/ui/views/game.go index 8f63419..64e463b 100644 --- a/pkg/ui/views/game.go +++ b/pkg/ui/views/game.go @@ -106,11 +106,7 @@ func (m GameModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { cmds = append(cmds, cmd, m.updateMovesListCmd()) case EndGameMsg: if msg.abandoned { - if m.network.Me() == m.playerPeer(1) || m.network.Me() == m.playerPeer(3) { - m.game.Outcome = string(chess.WhiteWon) - } else { - m.game.Outcome = string(chess.BlackWon) - } + _ = m.getGame()() m, cmd = m.handleDatabaseGameMsg(*m.game) cmds = append(cmds, cmd) } @@ -143,7 +139,7 @@ func (m GameModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { cmds = append(cmds, m.getMoves(), m.updateMovesListCmd()) if m.chessGame.Outcome() != chess.NoOutcome { - cmds = append(cmds, m.endGame(m.chessGame.Outcome().String())) + cmds = append(cmds, m.endGame(m.chessGame.Outcome().String(), false)) } } } |