Восстановил поломанную отправку и печать

This commit is contained in:
Халимов Рустам
2026-04-20 12:06:43 +03:00
parent b65c8f3633
commit c592197017
10 changed files with 214 additions and 6 deletions
@@ -329,6 +329,11 @@ class ChatDetailViewModel @Inject constructor(
}
}
is ChatEvent.UserTyping -> {
// Игнорируем свои же typing события
if (event.userId == getCurrentUserId()) {
android.util.Log.d("ChatDetailVM", "Ignoring own typing event")
return@onEach
}
_state.update { it.copy(isTyping = true) }
typingTimerJob?.cancel()
typingTimerJob = viewModelScope.launch {
@@ -337,6 +342,11 @@ class ChatDetailViewModel @Inject constructor(
}
}
is ChatEvent.UserStoppedTyping -> {
// Игнорируем свои же события
if (event.userId == getCurrentUserId()) {
android.util.Log.d("ChatDetailVM", "Ignoring own stopped typing event")
return@onEach
}
_state.update { it.copy(isTyping = false) }
}
is ChatEvent.MessagesRead -> {