From f484edbfaab7899ce9d4a1ef2ec02c44468713bc Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 17 Aug 2019 11:50:18 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/readbook/ReadBookViewModel.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt index 69e0d11b7..faf91f119 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt +++ b/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") if (!bookUrl.isNullOrEmpty()) { execute { - App.db.bookDao().getBook(bookUrl).let { - bookData.postValue(it) - } - bookData.value?.let { book -> + App.db.bookDao().getBook(bookUrl)?.let { book -> + bookData.postValue(book) bookSource = App.db.bookSourceDao().getBookSource(book.origin) bookSource?.let { webBook = WebBook(it)