Skip to content

Commit 5067573

Browse files
committed
[BOOK-233] refactor: 내서재에서 동일 필터 누를 시 early return 처리 및 진입 때마다 초기 로드 진행
1 parent d107c81 commit 5067573

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ class LibraryPresenter @AssistedInject constructor(
114114
}
115115

116116
is LibraryUiEvent.OnFilterClick -> {
117+
if (currentFilter == event.filterOption) {
118+
return
119+
}
120+
117121
currentFilter = event.filterOption
118122
filterLibraryBooks(status = currentFilter.getApiValue(), page = START_INDEX, size = PAGE_SIZE)
119123
}
@@ -148,13 +152,11 @@ class LibraryPresenter @AssistedInject constructor(
148152
}
149153

150154
LaunchedEffect(Unit) {
151-
if (uiState == UiState.Idle || uiState is UiState.Error) {
152-
filterLibraryBooks(
153-
status = currentFilter.getApiValue(),
154-
page = START_INDEX,
155-
size = PAGE_SIZE,
156-
)
157-
}
155+
filterLibraryBooks(
156+
status = currentFilter.getApiValue(),
157+
page = START_INDEX,
158+
size = PAGE_SIZE,
159+
)
158160
}
159161

160162
return LibraryUiState(

0 commit comments

Comments
 (0)