Skip to content

Commit

Permalink
BugFix for delayed update of the last messages in the Messages screen
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorpamplona committed Jul 3, 2023
1 parent fe4e03d commit 91c47b6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ private fun ChannelRoomCompose(
nav: (String) -> Unit
) {
val authorState by note.author!!.live().metadata.observeAsState()
val authorName = remember(authorState) {
val authorName = remember(note, authorState) {
authorState?.user?.toBestDisplayName()
}

val chanHex = remember { channel.idHex }

val channelState by channel.live.observeAsState()
val channelPicture by remember(channelState) {
val channelPicture by remember(note, channelState) {
derivedStateOf {
channel.profilePicture()
}
}
val channelName by remember(channelState) {
val channelName by remember(note, channelState) {
derivedStateOf {
channel.toBestDisplayName()
}
Expand All @@ -182,7 +182,7 @@ private fun ChannelRoomCompose(
noteEvent?.content()
}

var hasNewMessages = remember { mutableStateOf<Boolean>(false) }
val hasNewMessages = remember { mutableStateOf<Boolean>(false) }

WatchNotificationChanges(note, route, accountViewModel) { newHasNewMessages ->
if (hasNewMessages.value != newHasNewMessages) {
Expand Down

0 comments on commit 91c47b6

Please sign in to comment.