diff --git a/GameKit/Sources/Screen/GamePlay/GamePlayState.swift b/GameKit/Sources/Screen/GamePlay/GamePlayState.swift index 03ea620fd..e94d76a22 100644 --- a/GameKit/Sources/Screen/GamePlay/GamePlayState.swift +++ b/GameKit/Sources/Screen/GamePlay/GamePlayState.swift @@ -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: []) } } } diff --git a/GameKit/Sources/Screen/GamePlay/GamePlayView.swift b/GameKit/Sources/Screen/GamePlay/GamePlayView.swift index 5666dca1d..d1fbd8e5c 100644 --- a/GameKit/Sources/Screen/GamePlay/GamePlayView.swift +++ b/GameKit/Sources/Screen/GamePlay/GamePlayView.swift @@ -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()