Refactor command handling in ChatRepository for Android and iOS
- Reset commandLines and commandKind to default values when a command table event is received, ensuring a clean state for subsequent commands. - This change improves the handling of command events and maintains consistency across platforms.
This commit is contained in:
@@ -362,6 +362,8 @@ class ChatRepository(
|
||||
errorMessage = if (event.kind == "info" || event.kind.startsWith("login")) event.lines.joinToString(" | ") else current.errorMessage
|
||||
)
|
||||
is SocketEvent.CommandTable -> current.copy(
|
||||
commandLines = emptyList(),
|
||||
commandKind = null,
|
||||
commandTable = CommandTableState(event.title, event.columns, event.rows)
|
||||
)
|
||||
is SocketEvent.Error -> current.copy(errorMessage = event.message)
|
||||
|
||||
Reference in New Issue
Block a user