Skip to content

Commit

Permalink
feat: LedgerFilterScreen 예외 핸들링
Browse files Browse the repository at this point in the history
  • Loading branch information
jinukeu committed Jan 23, 2024
1 parent ce1a658 commit dc14044
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ fun LedgerFilterRoute(
viewModel: LedgerFilterViewModel = hiltViewModel(),
popBackStack: () -> Unit,
popBackStackWithFilter: (String) -> Unit,
handleException: (Throwable, () -> Unit) -> Unit,
) {
val uiState = viewModel.uiState.collectAsStateWithLifecycle().value
viewModel.sideEffect.collectWithLifecycle { sideEffect ->
when (sideEffect) {
is LedgerFilterSideEffect.HandleException -> TODO()
is LedgerFilterSideEffect.HandleException -> handleException(sideEffect.throwable, sideEffect.retry)
LedgerFilterSideEffect.PopBackStack -> popBackStack()
is LedgerFilterSideEffect.PopBackStackWithFilter -> popBackStackWithFilter(sideEffect.filter)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ fun NavGraphBuilder.receivedNavGraph(
LedgerFilterRoute(
popBackStack = popBackStack,
popBackStackWithFilter = popBackStackWithFilter,
handleException = handleException,
)
}

Expand Down

0 comments on commit dc14044

Please sign in to comment.