pull/32/head
kunfei 5 years ago
parent 585c19f7a7
commit a214afd1cb
  1. 8
      app/src/main/java/io/legado/app/ui/bookinfo/BookInfoViewModel.kt

@ -61,10 +61,12 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
App.db.bookSourceDao().getBookSource(book.origin)?.let { bookSource -> App.db.bookSourceDao().getBookSource(book.origin)?.let { bookSource ->
WebBook(bookSource).getChapterList(book) WebBook(bookSource).getChapterList(book)
.onSuccess(IO) { .onSuccess(IO) {
if (inBookshelf) { it?.let {
if (inBookshelf) {
App.db.bookChapterDao().insert(*it.toTypedArray())
}
chapterListData.postValue(it)
} }
chapterListData.postValue(it)
}.onError { }.onError {
toast(R.string.error_get_chapter_list) toast(R.string.error_get_chapter_list)
} }

Loading…
Cancel
Save