Fixes running new events on the main thread.
This commit is contained in:
@@ -193,6 +193,7 @@ import kotlinx.coroutines.flow.collectLatest
|
|||||||
import kotlinx.coroutines.flow.debounce
|
import kotlinx.coroutines.flow.debounce
|
||||||
import kotlinx.coroutines.flow.receiveAsFlow
|
import kotlinx.coroutines.flow.receiveAsFlow
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
import java.lang.Math.round
|
import java.lang.Math.round
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class, FlowPreview::class)
|
@OptIn(ExperimentalMaterial3Api::class, FlowPreview::class)
|
||||||
@@ -325,8 +326,10 @@ fun NewPostScreen(
|
|||||||
CloseButton(
|
CloseButton(
|
||||||
onPress = {
|
onPress = {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
|
withContext(Dispatchers.IO) {
|
||||||
postViewModel.sendDraftSync(relayList = relayList)
|
postViewModel.sendDraftSync(relayList = relayList)
|
||||||
postViewModel.cancel()
|
postViewModel.cancel()
|
||||||
|
}
|
||||||
delay(100)
|
delay(100)
|
||||||
nav.popBack()
|
nav.popBack()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user