Skip to content

Commit

Permalink
[i103] ChannelViewHolder shows invalid last message
Browse files Browse the repository at this point in the history
(cherry picked from commit 9c642a7)
  • Loading branch information
kanat authored and JcMinarro committed Jul 27, 2023
1 parent c99286c commit 7502b3e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,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 @@ -254,7 +254,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 7502b3e

Please sign in to comment.