fix: don't show word on replay

This commit is contained in:
Jake 2022-01-26 10:27:55 +00:00
parent dbfbf0efa2
commit 3ab9f195a3
1 changed files with 4 additions and 2 deletions

View File

@ -145,8 +145,10 @@ func (m model) View() string {
s += promptStyle.Render(footer) + "\n"
} else {
msg := ""
if m.board.CurrentGuess >= 6 {
msg += fmt.Sprintf("Oof! The word was %s.", m.board.Solution)
if m.board.CurrentGuess == -1 {
if m.board.Solution != "" {
msg += fmt.Sprintf("Oof! The word was %s.", m.board.Solution)
}
} else {
msg += fmt.Sprintf("Congrats! You guessed in %d.", m.board.CurrentGuess)
}