File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ class BookDetailPresenter @AssistedInject constructor(
8989 bookRepository.getBookDetail(screen.isbn13)
9090 .onSuccess { result ->
9191 bookDetail = result
92+ currentBookStatus = BookStatus .fromValue(result.userBookStatus) ? : BookStatus .BEFORE_READING
9293 }
9394 .onFailure { exception ->
9495 val handleErrorMessage = { message: String ->
@@ -111,6 +112,8 @@ class BookDetailPresenter @AssistedInject constructor(
111112 scope.launch {
112113 bookRepository.upsertBook(bookIsbn, bookStatus)
113114 .onSuccess {
115+ currentBookStatus = BookStatus .fromValue(bookStatus) ? : BookStatus .BEFORE_READING
116+ bookDetail = bookDetail.copy(userBookStatus = bookStatus)
114117 isBookUpdateBottomSheetVisible = false
115118 }
116119 .onFailure { exception ->
You can’t perform that action at this time.
0 commit comments