File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
feature/library/src/main/kotlin/com/ninecraft/booket/feature/library Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ class LibraryPresenter @AssistedInject constructor(
7979
8080 if (page == START_INDEX ) {
8181 uiState = UiState .Success
82+ footerState = FooterState .Idle
8283 } else {
8384 footerState = if (isLastPage) FooterState .End else FooterState .Idle
8485 }
@@ -121,11 +122,7 @@ class LibraryPresenter @AssistedInject constructor(
121122 }
122123
123124 is LibraryUiEvent .OnRetryClick -> {
124- if (currentPage == START_INDEX ) {
125- getLibraryBooks(status = currentFilter.getApiValue(), page = currentPage, size = PAGE_SIZE )
126- } else {
127- getLibraryBooks(status = currentFilter.getApiValue(), page = currentPage + 1 , size = PAGE_SIZE )
128- }
125+ getLibraryBooks(status = currentFilter.getApiValue(), page = currentPage, size = PAGE_SIZE )
129126 }
130127 }
131128 }
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ internal fun LibraryContent(
128128 }
129129
130130 is UiState .Error -> {
131- ErrorResult (state.uiState)
131+ ErrorResult (state = state, errorMessage = state .uiState.message )
132132 }
133133 }
134134 }
@@ -159,7 +159,7 @@ private fun EmptyResult() {
159159}
160160
161161@Composable
162- private fun ErrorResult (uiState : UiState . Error ) {
162+ private fun ErrorResult (state : LibraryUiState , errorMessage : String ) {
163163 Box (
164164 modifier = Modifier .fillMaxSize(),
165165 contentAlignment = Alignment .Center ,
@@ -174,14 +174,14 @@ private fun ErrorResult(uiState: UiState.Error) {
174174 )
175175 Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing2))
176176 Text (
177- text = uiState.message ,
177+ text = errorMessage ,
178178 color = ReedTheme .colors.contentSecondary,
179179 style = ReedTheme .typography.body1Medium,
180180 )
181181 Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing2))
182182 ReedButton (
183183 onClick = {
184- // TODO: 다시 시도
184+ state.eventSink( LibraryUiEvent . OnRetryClick )
185185 },
186186 sizeStyle = largeButtonStyle,
187187 colorStyle = ReedButtonColorStyle .PRIMARY ,
You can’t perform that action at this time.
0 commit comments