summaryrefslogtreecommitdiff
path: root/sw-ui/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'sw-ui/src/main')
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/Sagas.kt4
1 files changed, 2 insertions, 2 deletions
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 45cc474b..5c426a51 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
@@ -22,8 +22,8 @@ typealias SwSagaContext = SagaContext<SwState, RAction, WrapperAction>
@OptIn(ExperimentalCoroutinesApi::class)
suspend fun SwSagaContext.rootSaga() = coroutineScope {
val action = next<RequestChooseName>()
- val port = if (isProdEnv()) window.location.port.ifEmpty { "80" } else "8000"
- val session = SevenWondersClient().connect("localhost:$port")
+ val serverHost = if (isProdEnv()) window.location.host else "localhost:8000"
+ val session = SevenWondersClient().connect(serverHost)
console.info("Connected to Seven Wonders web socket API")
launch(start = CoroutineStart.UNDISPATCHED) {
bgstack15