Fix for not clearing the new post message. It adds a delay to allow the composer to save the viewModel after calling cancel

pull/623/head
Vitor Pamplona 2023-09-25 15:29:13 -04:00
rodzic a3865e68bd
commit af9b0b444c
1 zmienionych plików z 9 dodań i 5 usunięć

Wyświetl plik

@ -214,7 +214,10 @@ fun NewPostView(
PostButton(
onPost = {
postViewModel.sendPost(relayList = relayList)
onClose()
scope.launch {
delay(100)
onClose()
}
},
isActive = postViewModel.canPost()
)
@ -224,7 +227,10 @@ fun NewPostView(
Spacer(modifier = StdHorzSpacer)
CloseButton(onPress = {
postViewModel.cancel()
onClose()
scope.launch {
delay(100)
onClose()
}
})
},
backgroundColor = MaterialTheme.colors.surface,
@ -1220,9 +1226,7 @@ private fun MarkAsSensitive(
@Composable
fun CloseButton(onPress: () -> Unit) {
Button(
onClick = {
onPress()
},
onClick = onPress,
shape = ButtonBorder,
colors = ButtonDefaults
.buttonColors(