diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt index 0b72847d2..74f9103fc 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewPostView.kt @@ -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(