summaryrefslogtreecommitdiff
path: root/sw-ui-kt/src
diff options
context:
space:
mode:
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