TP-54641 | Back navigation recomposition fix (#10577)
This commit is contained in:
@@ -47,12 +47,16 @@ import com.ramcosta.composedestinations.annotation.RootNavGraph
|
||||
@Destination
|
||||
@RootNavGraph(true)
|
||||
fun ManageLoanScreen(viewModel: ManageLoanVM, bundle: Bundle? = Bundle()) {
|
||||
val state = viewModel.manageLoanData.collectAsStateWithLifecycle().value
|
||||
LaunchedEffect(Unit) {
|
||||
if (state is NetworkResponseState.Success) {
|
||||
return@LaunchedEffect
|
||||
}
|
||||
viewModel.fetchScreenData(viewModel.tabId, PL_MANAGE_LOAN_TAB)
|
||||
}
|
||||
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
when (val state = viewModel.manageLoanData.collectAsStateWithLifecycle().value) {
|
||||
when (state) {
|
||||
is NetworkResponseState.Loading -> {
|
||||
ContentShimmer()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user