Fix WebSocket connection stuck on subsequent launches (Issue #45)
This commit is contained in:
@@ -79,6 +79,15 @@ class ChatViewModel(
|
|||||||
handleWsEvent(event)
|
handleWsEvent(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wsClient.isConnected) {
|
||||||
|
_uiState.update { it.copy(isConnected = true, isLoading = false) }
|
||||||
|
addSystemMessage("Connected to Hermes")
|
||||||
|
loadSessions()
|
||||||
|
if (_uiState.value.currentSessionId == null) {
|
||||||
|
createNewSession()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleWsEvent(event: WsEvent) {
|
private fun handleWsEvent(event: WsEvent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user