Fixed resend menu not visible when message goes into error state unless conversation is left & opened again

This commit is contained in:
Sylvain Berfini 2025-02-18 16:33:50 +01:00
parent ec9c7bd070
commit ef79475525
2 changed files with 5 additions and 3 deletions

View file

@ -100,7 +100,7 @@ class MessageModel
val isOutgoing = chatMessage.isOutgoing
val isInError = chatMessage.state == ChatMessage.State.NotDelivered
val isInError = MutableLiveData<Boolean>()
val timestamp = chatMessage.time
@ -224,6 +224,7 @@ class MessageModel
}
}
}
isInError.postValue(messageState == ChatMessage.State.NotDelivered)
}
@WorkerThread
@ -297,6 +298,8 @@ class MessageModel
init {
updateAvatarModel()
isInError.postValue(chatMessage.state == ChatMessage.State.NotDelivered)
groupedWithNextMessage.postValue(isGroupedWithNextOne)
groupedWithPreviousMessage.postValue(isGroupedWithPreviousOne)
isPlayingVoiceRecord.postValue(false)

View file

@ -72,7 +72,6 @@ class ChatMessageLongPressViewModel : GenericViewModel() {
val onDismissedEvent = MutableLiveData<Event<Boolean>>()
private lateinit var emojiBottomSheet: ChatBubbleEmojiPickerBottomSheetBinding
private lateinit var emojiBottomSheetBehavior: BottomSheetBehavior<View>
init {
@ -91,7 +90,7 @@ class ChatMessageLongPressViewModel : GenericViewModel() {
hideCopyTextToClipboard.value = model.text.value.isNullOrEmpty()
isChatRoomReadOnly.value = model.chatRoomIsReadOnly
isMessageOutgoing.value = model.isOutgoing
isMessageInError.value = model.isInError
isMessageInError.value = model.isInError.value == true
horizontalBias.value = if (model.isOutgoing) 1f else 0f
messageModel.value = model