Colton Idle
07/29/2021, 6:41 PM@Composable
fun ForgotPasswordScreen(successEvent: () -> Unit, vm: ForgotPasswordScreenViewModel){
...
~buttonOnClick {
vm.makeNetworkCall(successEvent)
}
...
}
2. successEvent: () -> Unit, is a navigational event that takes me back to SignInScreen
3. ForgotPasswordScreenViewModel has fun makeNetworkCall(onNetworkCallCompletedSuccessfully: () -> Unit)
and on completion of the network call, if (call.isSuccessful) successEvent()
When I throttle the network call (for testing) it takes like 10 seconds, and I background the app, wait 20+ seconds... and I come back in the app, I can see that the app navigated successfully and the SignInScreen is showing. I guess I was wrong in thinking that the successEvent() wouldn't have any action since the app was backgrounded?Albert Chang
07/30/2021, 12:08 AMColton Idle
07/30/2021, 12:45 AM