From f6510343034cd41799793e0b532be03fa1660722 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sat, 24 Jun 2023 18:08:11 -0400 Subject: [PATCH] Better starting point for the following observer --- .../com/vitorpamplona/amethyst/ui/note/ChatroomCompose.kt | 1 - .../java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ChatroomCompose.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ChatroomCompose.kt index 1a60d6495..5c58429de 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ChatroomCompose.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/ChatroomCompose.kt @@ -56,7 +56,6 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.theme.DoubleHorzSpacer import com.vitorpamplona.amethyst.ui.theme.Size55Modifier import com.vitorpamplona.amethyst.ui.theme.Size55dp -import com.vitorpamplona.amethyst.ui.theme.StdHorzSpacer import com.vitorpamplona.amethyst.ui.theme.grayText import com.vitorpamplona.amethyst.ui.theme.placeholderText import kotlinx.coroutines.Dispatchers diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt index d2072e39b..249865fe6 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt @@ -3155,8 +3155,10 @@ fun PictureAndFollowingMark( @Composable private fun ObserveAndDisplayFollowingMark(userHex: String, iconSize: Dp, accountViewModel: AccountViewModel) { val showFollowingMark by accountViewModel.userFollows.map { - it.user.isFollowingCached(userHex) == true || (userHex == accountViewModel.account.userProfile().pubkeyHex) - }.observeAsState(true) + it.user.isFollowingCached(userHex) || (userHex == accountViewModel.account.userProfile().pubkeyHex) + }.observeAsState( + accountViewModel.account.userProfile().isFollowingCached(userHex) || (userHex == accountViewModel.account.userProfile().pubkeyHex) + ) if (showFollowingMark) { FollowingIcon(iconSize)