File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,7 @@ import kotlinx.collections.immutable.ImmutableList
3535import kotlinx.collections.immutable.persistentListOf
3636import kotlinx.collections.immutable.toImmutableList
3737import kotlinx.collections.immutable.toPersistentList
38- import kotlinx.coroutines.CancellationException
3938import kotlinx.coroutines.async
40- import kotlinx.coroutines.coroutineScope
4139import kotlinx.coroutines.launch
4240import java.time.LocalDateTime
4341
@@ -78,11 +76,11 @@ class BookDetailPresenter @AssistedInject constructor(
7876 var sideEffect by rememberRetained { mutableStateOf<BookDetailSideEffect ?>(null ) }
7977
8078 @Suppress(" TooGenericExceptionCaught" )
81- suspend fun initialLoad () {
79+ fun initialLoad () {
8280 uiState = UiState .Loading
8381
8482 try {
85- coroutineScope {
83+ scope.launch {
8684 val bookDetailDef = async { bookRepository.getBookDetail(screen.isbn13).getOrThrow() }
8785 val seedsDef = async { bookRepository.getSeedsStats(screen.userBookId).getOrThrow() }
8886 val readingRecordsDef = async {
@@ -109,8 +107,6 @@ class BookDetailPresenter @AssistedInject constructor(
109107
110108 uiState = UiState .Success
111109 }
112- } catch (ce: CancellationException ) {
113- throw ce
114110 } catch (e: Throwable ) {
115111 uiState = UiState .Error (e)
116112
You can’t perform that action at this time.
0 commit comments