Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

Commit

Permalink
Use onIO extension function
Browse files Browse the repository at this point in the history
  • Loading branch information
jobobby04 committed Aug 19, 2022
1 parent d722ffe commit 502847d
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ import com.google.accompanist.pager.rememberPagerState
import com.google.accompanist.swiperefresh.SwipeRefresh
import com.google.accompanist.swiperefresh.SwipeRefreshState
import com.google.android.material.bottomsheet.BottomSheetDialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext

/*
* This file is part of Shosetsu.
Expand Down Expand Up @@ -458,7 +456,7 @@ fun LibraryPager(
library.categories[it].id
}
val items by produceState(emptyList(), library, it, id) {
value = withContext(Dispatchers.IO) {
value = onIO {
library.novels[id].orEmpty()
}
}
Expand Down

0 comments on commit 502847d

Please sign in to comment.