Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stephtelolahy committed Nov 26, 2023
1 parent 06ac516 commit ccf9b72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions GameKit/Sources/Screen/GamePlay/GamePlayState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ import Redux

public struct GamePlayState: Codable, Equatable {
var players: [Player]
var controlled: String?
var message = String()
var message: String?

static func from(globalState: AppState) -> GamePlayState {
if let lastScreen = globalState.screens.last,
case let .game(gameState) = lastScreen {
gameState
} else {
fatalError("unexpected")
.init(players: [])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion GameKit/Sources/Screen/GamePlay/GamePlayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct GamePlayView: View {
}
}
}
Text(String(format: String(localized: "game.message", bundle: .module), state.message))
Text(String(format: String(localized: "game.message", bundle: .module), state.message ?? ""))
.font(.subheadline)
.foregroundColor(.accentColor)
.padding()
Expand Down

0 comments on commit ccf9b72

Please sign in to comment.