mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-17 21:31:57 +01:00
Fixes running new events on the main thread.
This commit is contained in:
parent
08dd634eae
commit
41e47fa71d
@ -193,6 +193,7 @@ import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.flow.debounce
|
||||
import kotlinx.coroutines.flow.receiveAsFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.lang.Math.round
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class, FlowPreview::class)
|
||||
@ -325,8 +326,10 @@ fun NewPostScreen(
|
||||
CloseButton(
|
||||
onPress = {
|
||||
scope.launch {
|
||||
postViewModel.sendDraftSync(relayList = relayList)
|
||||
postViewModel.cancel()
|
||||
withContext(Dispatchers.IO) {
|
||||
postViewModel.sendDraftSync(relayList = relayList)
|
||||
postViewModel.cancel()
|
||||
}
|
||||
delay(100)
|
||||
nav.popBack()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user