TP-54641 | Back navigation recomposition fix (#10577)

This commit is contained in:
shreyansu raj
2024-04-22 16:57:57 +05:30
committed by GitHub
parent 596d0bd268
commit f7983db8bd

View File

@@ -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()
}