Correctly maps the write status of the outbox relays.

This commit is contained in:
Vitor Pamplona 2024-10-15 15:53:00 -04:00
parent 9c29bf3f25
commit b8112ff1aa
2 changed files with 3 additions and 4 deletions

View File

@ -357,7 +357,7 @@ class Account(
mappedRelaySet.map { relay ->
val nip65setup = nip65RelaySet?.firstOrNull { relay.url == it.relayUrl }
if (nip65setup != null) {
val write = nip65setup.type == AdvertisedRelayListEvent.AdvertisedRelayType.BOTH || nip65setup.type == AdvertisedRelayListEvent.AdvertisedRelayType.READ
val write = nip65setup.type == AdvertisedRelayListEvent.AdvertisedRelayType.BOTH || nip65setup.type == AdvertisedRelayListEvent.AdvertisedRelayType.WRITE
RelaySetupInfo(
relay.url,
@ -377,7 +377,7 @@ class Account(
nip65RelaySet?.forEach { newNip65Setup ->
if (mappedRelaySet.none { it.url == newNip65Setup.relayUrl }) {
val write = newNip65Setup.type == AdvertisedRelayListEvent.AdvertisedRelayType.BOTH || newNip65Setup.type == AdvertisedRelayListEvent.AdvertisedRelayType.READ
val write = newNip65Setup.type == AdvertisedRelayListEvent.AdvertisedRelayType.BOTH || newNip65Setup.type == AdvertisedRelayListEvent.AdvertisedRelayType.WRITE
mappedRelaySet = mappedRelaySet +
RelaySetupInfo(

View File

@ -121,7 +121,6 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewmodel.compose.viewModel
import coil.compose.AsyncImage
@ -201,7 +200,6 @@ fun NewPostView(
accountViewModel: AccountViewModel,
nav: INav,
) {
val lifecycleOwner = LocalLifecycleOwner.current
val postViewModel: NewPostViewModel = viewModel()
postViewModel.wantsDirectMessage = enableMessageInterface
@ -211,6 +209,7 @@ fun NewPostView(
val scope = rememberCoroutineScope()
var showRelaysDialog by remember { mutableStateOf(false) }
var relayList = remember { accountViewModel.account.activeWriteRelays().toImmutableList() }
var showCamera by remember {
mutableStateOf(true)
}