adds save when closing the screen on new posts.

This commit is contained in:
Vitor Pamplona
2024-04-03 10:20:19 -04:00
parent b88723b68b
commit 0e8d2fc33a
@@ -235,7 +235,12 @@ fun NewPostView(
} }
Dialog( Dialog(
onDismissRequest = { onClose() }, onDismissRequest = {
scope.launch {
postViewModel.sendDraftSync(relayList = relayList)
onClose()
}
},
properties = properties =
DialogProperties( DialogProperties(
usePlatformDefaultWidth = false, usePlatformDefaultWidth = false,
@@ -294,8 +299,9 @@ fun NewPostView(
Spacer(modifier = StdHorzSpacer) Spacer(modifier = StdHorzSpacer)
CloseButton( CloseButton(
onPress = { onPress = {
postViewModel.cancel()
scope.launch { scope.launch {
postViewModel.sendDraftSync(relayList = relayList)
postViewModel.cancel()
delay(100) delay(100)
onClose() onClose()
} }