diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/relays/RelayInformationDialog.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/relays/RelayInformationDialog.kt index 368f5b3ee..3fe171c84 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/relays/RelayInformationDialog.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/relays/RelayInformationDialog.kt @@ -100,7 +100,11 @@ fun RelayInformationDialog( ), ) { Surface { - val color = mutableStateOf(Color.Transparent) + val color = + remember { + mutableStateOf(Color.Transparent) + } + val context = LocalContext.current LazyColumn( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayListBox.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayListBox.kt index 5cd95e3a5..c4ea66521 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayListBox.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/RelayListBox.kt @@ -59,7 +59,6 @@ import com.vitorpamplona.amethyst.ui.theme.Size17Modifier import com.vitorpamplona.amethyst.ui.theme.StdVertSpacer import com.vitorpamplona.amethyst.ui.theme.noteComposeRelayBox import com.vitorpamplona.amethyst.ui.theme.placeholderText -import kotlinx.coroutines.flow.map @Composable fun RelayBadges( @@ -125,13 +124,9 @@ fun WatchAndRenderRelay( val noteRelays by baseNote .flow() .relays.stateFlow - .map { - it.note.relays.getOrNull(relayIndex) - }.collectAsStateWithLifecycle( - baseNote.relays.getOrNull(relayIndex), - ) + .collectAsStateWithLifecycle() - CrossfadeIfEnabled(targetState = noteRelays, label = "RenderRelay", modifier = Size17Modifier, accountViewModel = accountViewModel) { + CrossfadeIfEnabled(targetState = noteRelays.note.relays.getOrNull(relayIndex), label = "RenderRelay", modifier = Size17Modifier, accountViewModel = accountViewModel) { if (it != null) { RenderRelay(it, accountViewModel, nav) }