summaryrefslogtreecommitdiff
path: root/sw-ui
diff options
context:
space:
mode:
Diffstat (limited to 'sw-ui')
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt1
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt8
2 files changed, 2 insertions, 7 deletions
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt
index b1d730a0..61d7a60c 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt
@@ -100,6 +100,7 @@ private fun gameStateReducer(gameState: GameState?, action: RAction): GameState?
is StartTransactionSelection -> gameState?.copy(transactionSelector = action.transactionSelector)
is CancelTransactionSelection -> gameState?.copy(transactionSelector = null)
is RequestPrepareMove -> gameState?.copy(transactionSelector = null)
+ is LeaveLobbyAction -> null
else -> gameState
}
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt
index 4e196afb..53ade155 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt
@@ -87,12 +87,12 @@ private fun SwSagaContext.launchApiActionHandlersIn(scope: CoroutineScope, sessi
scope.launchOnEach<RequestAddBot> { session.addBot(it.botDisplayName) }
scope.launchOnEach<RequestReorderPlayers> { session.reorderPlayers(it.orderedPlayers) }
scope.launchOnEach<RequestReassignWonders> { session.reassignWonders(it.wonders) }
- // mapAction<RequestUpdateSettings> { updateSettings(it.settings) }
scope.launchOnEach<RequestStartGame> { session.startGame() }
scope.launchOnEach<RequestSayReady> { session.sayReady() }
scope.launchOnEach<RequestPrepareMove> { session.prepareMove(it.move) }
scope.launchOnEach<RequestUnprepareMove> { session.unprepareMove() }
+ scope.launchOnEach<RequestLeaveGame> { session.leaveGame() }
}
private fun SwSagaContext.launchApiEventHandlersIn(scope: CoroutineScope, session: SevenWondersSession) {
@@ -118,10 +118,4 @@ private fun SwSagaContext.launchApiEventHandlersIn(scope: CoroutineScope, sessio
dispatch(Navigate(Route.GAME))
}
}
-
- // FIXME map this actions like others and await server event instead
- scope.launchOnEach<RequestLeaveGame> {
- session.leaveGame()
- dispatch(Navigate(Route.GAME_BROWSER))
- }
}
bgstack15