Skip to content

Commit

Permalink
Fix for not clearing the new post message. It adds a delay to allow t…
Browse files Browse the repository at this point in the history
…he composer to save the viewModel after calling cancel
  • Loading branch information
vitorpamplona committed Sep 25, 2023
1 parent a3865e6 commit af9b0b4
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ fun NewPostView(
PostButton(
onPost = {
postViewModel.sendPost(relayList = relayList)
onClose()
scope.launch {
delay(100)
onClose()
}
},
isActive = postViewModel.canPost()
)
Expand All @@ -224,7 +227,10 @@ fun NewPostView(
Spacer(modifier = StdHorzSpacer)
CloseButton(onPress = {
postViewModel.cancel()
onClose()
scope.launch {
delay(100)
onClose()
}
})
},
backgroundColor = MaterialTheme.colors.surface,
Expand Down Expand Up @@ -1220,9 +1226,7 @@ private fun MarkAsSensitive(
@Composable
fun CloseButton(onPress: () -> Unit) {
Button(
onClick = {
onPress()
},
onClick = onPress,
shape = ButtonBorder,
colors = ButtonDefaults
.buttonColors(
Expand Down

0 comments on commit af9b0b4

Please sign in to comment.