Skip to content

Commit

Permalink
[i103] ChannelViewHolder shows invalid last message
Browse files Browse the repository at this point in the history
  • Loading branch information
kanat committed Jul 26, 2023
1 parent 37b2c85 commit 9c642a7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ internal class ChannelViewHolder @JvmOverloads constructor(

if (typingUsersChanged) {
typingIndicatorView.setTypingUsers(channelItem.typingUsers)
lastMessageLabel.isVisible = channelItem.typingUsers.isEmpty()
lastMessageLabel.isVisible = channelItem.typingUsers.isEmpty() && lastMessage.isNotNull()
}

muteIcon.isVisible = channelItem.channel.isMuted
Expand All @@ -257,7 +257,10 @@ internal class ChannelViewHolder @JvmOverloads constructor(
lastMessageLabel.isVisible = lastMessage.isNotNull()
lastMessageTimeLabel.isVisible = lastMessage.isNotNull()

lastMessage ?: return
lastMessage ?: return run {
lastMessageLabel.text = ""
lastMessageTimeLabel.text = ""
}

lastMessageLabel.text = ChatUI.messagePreviewFormatter.formatMessagePreview(
channel = channel,
Expand Down

0 comments on commit 9c642a7

Please sign in to comment.