mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-08 20:08:06 +02:00
Starts relay observers with a non null value
This commit is contained in:
parent
2ce16325a1
commit
35cd9cb6c5
@ -24,14 +24,13 @@ import com.vitorpamplona.amethyst.ui.theme.ShowMoreRelaysButtonBoxModifer
|
||||
import com.vitorpamplona.amethyst.ui.theme.ShowMoreRelaysButtonIconButtonModifier
|
||||
import com.vitorpamplona.amethyst.ui.theme.ShowMoreRelaysButtonIconModifier
|
||||
import com.vitorpamplona.amethyst.ui.theme.placeholderText
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
|
||||
@OptIn(ExperimentalLayoutApi::class)
|
||||
@Composable
|
||||
fun RelayBadges(baseNote: Note, accountViewModel: AccountViewModel, nav: (String) -> Unit) {
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
|
||||
val relayList by baseNote.live().relayInfo.observeAsState(persistentListOf())
|
||||
val relayList by baseNote.live().relayInfo.observeAsState(baseNote.relays)
|
||||
|
||||
Spacer(DoubleVertSpacer)
|
||||
|
||||
|
@ -57,7 +57,7 @@ public fun RelayBadgesHorizontal(baseNote: Note, accountViewModel: AccountViewMo
|
||||
@OptIn(ExperimentalLayoutApi::class)
|
||||
@Composable
|
||||
fun RenderRelayList(baseNote: Note, expanded: MutableState<Boolean>, accountViewModel: AccountViewModel, nav: (String) -> Unit) {
|
||||
val noteRelays by baseNote.live().relayInfo.observeAsState()
|
||||
val noteRelays by baseNote.live().relayInfo.observeAsState(baseNote.relays)
|
||||
|
||||
FlowRow(StdStartPadding, verticalArrangement = Arrangement.Center) {
|
||||
if (expanded.value) {
|
||||
|
@ -402,9 +402,9 @@ private fun VideoUserOptionAction(
|
||||
@OptIn(ExperimentalLayoutApi::class)
|
||||
@Composable
|
||||
private fun RelayBadges(baseNote: Note, accountViewModel: AccountViewModel, nav: (String) -> Unit) {
|
||||
val noteRelays by baseNote.live().relayInfo.observeAsState()
|
||||
val noteRelays by baseNote.live().relayInfo.observeAsState(baseNote.relays)
|
||||
|
||||
FlowRow() {
|
||||
FlowRow {
|
||||
noteRelays?.forEach { relayInfo ->
|
||||
RenderRelay(relayInfo, accountViewModel, nav)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user