private fun showEmptyState() { messagesState = messagesState.copy(isLoading = false, messageItems = emptyList()) }
If there's an error, we just set the current state to be empty - 'isLoading' as false and 'messages' as an empty list.