summaryrefslogtreecommitdiff
path: root/sw-ui-kt/src
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-03-30 18:08:29 +0200
committerJoffrey Bion <joffrey.bion@booking.com>2020-03-30 19:27:39 +0200
commit83464b7e49ae4087f543de5571c51e28f2700b45 (patch)
treef822b860cbc9c0763ac0f13cdaaa122d2fa52d12 /sw-ui-kt/src
parentSend turn info without hands when entering game (diff)
downloadseven-wonders-83464b7e49ae4087f543de5571c51e28f2700b45.tar.gz
seven-wonders-83464b7e49ae4087f543de5571c51e28f2700b45.tar.bz2
seven-wonders-83464b7e49ae4087f543de5571c51e28f2700b45.zip
Minor cleanup
Diffstat (limited to 'sw-ui-kt/src')
-rw-r--r--sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt4
-rw-r--r--sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt4
2 files changed, 4 insertions, 4 deletions
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt
index d8dee5df..8b38e010 100644
--- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt
+++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/SevenWondersUi.kt
@@ -1,7 +1,7 @@
package org.luxons.sevenwonders.ui
import kotlinx.coroutines.GlobalScope
-import kotlinx.coroutines.promise
+import kotlinx.coroutines.launch
import org.luxons.sevenwonders.ui.components.application
import org.luxons.sevenwonders.ui.redux.SwState
import org.luxons.sevenwonders.ui.redux.configureStore
@@ -40,7 +40,7 @@ private fun initializeAndRender(rootElement: Element) {
private fun initRedux(): Store<SwState, RAction, WrapperAction> {
val sagaManager = SagaManager<SwState, RAction, WrapperAction>()
val store = configureStore(sagaManager = sagaManager)
- GlobalScope.promise {
+ GlobalScope.launch {
sagaManager.launchSaga(this) {
rootSaga()
}
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt
index 2f856c7f..c4a92581 100644
--- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt
+++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt
@@ -21,7 +21,7 @@ suspend fun SwSagaContext.rootSaga() = coroutineScope {
console.info("Connected to Seven Wonders web socket API")
launch {
- errorSaga(session)
+ serverErrorSaga(session)
}
yield() // ensures the error saga starts
@@ -38,7 +38,7 @@ suspend fun SwSagaContext.rootSaga() = coroutineScope {
}
}
-private suspend fun errorSaga(session: SevenWondersSession) {
+private suspend fun serverErrorSaga(session: SevenWondersSession) {
val errorsSub = session.watchErrors()
for (err in errorsSub.messages) {
// TODO use blueprintjs toaster
bgstack15