修复文件类书源换源后阅读按钮工作不正确的bug

pull/2361/head
Xwite 2 years ago committed by Xwite
parent 2003cf5d06
commit e6f431a139
  1. 3
      app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt

@ -32,7 +32,7 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
var inBookshelf = false var inBookshelf = false
var bookSource: BookSource? = null var bookSource: BookSource? = null
private var changeSourceCoroutine: Coroutine<*>? = null private var changeSourceCoroutine: Coroutine<*>? = null
var isImportBookOnLine: Boolean val isImportBookOnLine: Boolean
get() = (bookSource?.bookSourceType ?: BookType.local) == BookType.file get() = (bookSource?.bookSourceType ?: BookType.local) == BookType.file
fun initData(intent: Intent) { fun initData(intent: Intent) {
@ -306,7 +306,6 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
fun changeToLocalBook(bookUrl: String) { fun changeToLocalBook(bookUrl: String) {
appDb.bookDao.getBook(bookUrl)?.let { localBook -> appDb.bookDao.getBook(bookUrl)?.let { localBook ->
isImportBookOnLine = false
inBookshelf = true inBookshelf = true
LocalBook.mergeBook(localBook, bookData.value).let { LocalBook.mergeBook(localBook, bookData.value).let {
bookData.postValue(it) bookData.postValue(it)

Loading…
Cancel
Save