This commit is contained in:
kunfei committed 2022-02-27 08:42:22 +08:00
1 parent 314141d29f
commit 818510cc87
1 file changed
+3 -1
@@ -25,10 +25,12 @@ import io.legado.app.ui.book.search.SearchActivity
import io.legado.app.ui.main.bookshelf.BaseBookshelfFragment import io.legado.app.ui.main.bookshelf.BaseBookshelfFragment
import io.legado.app.utils.* import io.legado.app.utils.*
import io.legado.app.utils.viewbindingdelegate.viewBinding import io.legado.app.utils.viewbindingdelegate.viewBinding
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.conflate import kotlinx.coroutines.flow.conflate
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlin.math.max import kotlin.math.max
@@ -138,7 +140,7 @@ class BookshelfFragment2 : BaseBookshelfFragment(R.layout.fragment_bookshelf1),
it.durChapterTime it.durChapterTime
} }
} }
}.catch { }.flowOn(Dispatchers.Default).catch {
AppLog.put("书架更新出错", it) AppLog.put("书架更新出错", it)
}.conflate().collect { list -> }.conflate().collect { list ->
books = list books = list