pull/32/head
kunfei 5 years ago
parent 21adbcdca2
commit f484edbfaa
  1. 6
      app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt

@ -26,10 +26,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
val bookUrl = intent.getStringExtra("bookUrl") val bookUrl = intent.getStringExtra("bookUrl")
if (!bookUrl.isNullOrEmpty()) { if (!bookUrl.isNullOrEmpty()) {
execute { execute {
App.db.bookDao().getBook(bookUrl).let { App.db.bookDao().getBook(bookUrl)?.let { book ->
bookData.postValue(it) bookData.postValue(book)
}
bookData.value?.let { book ->
bookSource = App.db.bookSourceDao().getBookSource(book.origin) bookSource = App.db.bookSourceDao().getBookSource(book.origin)
bookSource?.let { bookSource?.let {
webBook = WebBook(it) webBook = WebBook(it)

Loading…
Cancel
Save