Othman El Jazouli
10/22/2024, 4:04 PMval lifecycleOwner = LocalLifecycleOwner.current
val navigationEventFlowLifecycleAware = remember(viewModel.navigationEventFlow, lifecycleOwner) {
viewModel.navigationEventFlow.flowWithLifecycle(lifecycleOwner.lifecycle, Lifecycle.State.STARTED)
}
i have a bottomsheet that opens a url, and user comes back
when this is resumed, the view sends an intent to the viewmodel
LifecycleResumeEffect(Unit) {
viewModel.intent(Intent.CheckAgain)
onPauseOrDispose {}
}
and the viewmodel then decides to close by sending an event to that flow
but the screen doesnt close because the flow is found to not be collecting yet, what is strange to me, is the flow is supposed to be collecting when lifecycle is STARTED, which happens before RESUMED, so technically this all should work
any suggestions pleaseZach Klippenstein (he/him) [MOD]
10/22/2024, 7:34 PMOthman El Jazouli
10/22/2024, 7:35 PMflowWithLifecycle(lifecycleOwner.lifecycle, Lifecycle.State.STARTED)
doesn’t necessarily guarantee the flow will start collecting then, and in my case it starts collecting much after RESUME state