kopia lustrzana https://github.com/vitorpamplona/amethyst
Uses default thread to wait for a 250 milliseconds before navigating away from the video upload page.
rodzic
9589f68028
commit
b641684377
|
@ -88,8 +88,10 @@ import com.vitorpamplona.amethyst.ui.screen.NostrVideoFeedViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.screen.ScrollStateKeys
|
import com.vitorpamplona.amethyst.ui.screen.ScrollStateKeys
|
||||||
import com.vitorpamplona.amethyst.ui.screen.rememberForeverPagerState
|
import com.vitorpamplona.amethyst.ui.screen.rememberForeverPagerState
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun VideoScreen(
|
fun VideoScreen(
|
||||||
|
@ -415,11 +417,13 @@ fun NewImageButton(accountViewModel: AccountViewModel, nav: (String) -> Unit) {
|
||||||
|
|
||||||
val postViewModel: NewMediaModel = viewModel()
|
val postViewModel: NewMediaModel = viewModel()
|
||||||
postViewModel.onceUploaded {
|
postViewModel.onceUploaded {
|
||||||
scope.launch {
|
scope.launch(Dispatchers.Default) {
|
||||||
// awaits an refresh on the list
|
// awaits an refresh on the list
|
||||||
delay(250)
|
delay(250)
|
||||||
val route = Route.Video.route.replace("{scrollToTop}", "true")
|
withContext(Dispatchers.Main) {
|
||||||
nav(route)
|
val route = Route.Video.route.replace("{scrollToTop}", "true")
|
||||||
|
nav(route)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue