Skip to content

Commit b68ed25

Browse files
committed
[BOOK-367] refactor: Guest Mode에서 내서재 필터링 시 불필요한 API가 호출되는 문제 수정
1 parent 1914ff2 commit b68ed25

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,13 @@ class LibraryPresenter @AssistedInject constructor(
108108
footerState = FooterState.Error(errorMessage)
109109
}
110110

111-
if (userState !is UserState.Guest) {
112-
handleException(
113-
exception = exception,
114-
onError = {},
115-
onLoginRequired = {
116-
navigator.resetRoot(LoginScreen())
117-
},
118-
)
119-
}
111+
handleException(
112+
exception = exception,
113+
onError = {},
114+
onLoginRequired = {
115+
navigator.resetRoot(LoginScreen())
116+
},
117+
)
120118
}
121119
}
122120
}
@@ -148,7 +146,10 @@ class LibraryPresenter @AssistedInject constructor(
148146
}
149147

150148
currentFilter = event.filterOption
151-
filterLibraryBooks(status = currentFilter.getApiValue(), page = START_INDEX, size = PAGE_SIZE)
149+
150+
if (userState !is UserState.Guest) {
151+
filterLibraryBooks(status = currentFilter.getApiValue(), page = START_INDEX, size = PAGE_SIZE)
152+
}
152153
}
153154

154155
is LibraryUiEvent.OnBookClick -> {

0 commit comments

Comments
 (0)