diff --git a/apps/tui/src/main/kotlin/com/correx/apps/tui/TuiApp.kt b/apps/tui/src/main/kotlin/com/correx/apps/tui/TuiApp.kt index 05872a55..d9f5b070 100644 --- a/apps/tui/src/main/kotlin/com/correx/apps/tui/TuiApp.kt +++ b/apps/tui/src/main/kotlin/com/correx/apps/tui/TuiApp.kt @@ -63,12 +63,12 @@ fun main(args: Array) { } } - launch { + effectScope.launch { ws.messages.collect { msg -> runner.runOnRenderThread { dispatch(Action.ServerEventReceived(msg)) } } } - launch { + effectScope.launch { ws.connection.collect { ev -> val action = when (ev) { is ConnectionEvent.Connected -> Action.Connected @@ -78,7 +78,7 @@ fun main(args: Array) { runner.runOnRenderThread { dispatch(action) } } } - launch { ws.connect() } + effectScope.launch { ws.connect() } val handler = EventHandler { event, _ -> if (event is TambouiKeyEvent) {