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

pull/2353/head^2
Xwite 2 years ago committed by GitHub
parent 19722fd6c1
commit 2003cf5d06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt

@ -32,7 +32,8 @@ 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 = false var isImportBookOnLine: Boolean
get() = (bookSource?.bookSourceType ?: BookType.local) == BookType.file
fun initData(intent: Intent) { fun initData(intent: Intent) {
execute { execute {
@ -76,7 +77,6 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
upCoverByRule(book) upCoverByRule(book)
bookSource = if (book.isLocalBook()) null else bookSource = if (book.isLocalBook()) null else
appDb.bookSourceDao.getBookSource(book.origin) appDb.bookSourceDao.getBookSource(book.origin)
isImportBookOnLine = (bookSource?.bookSourceType ?: BookType.local) == BookType.file
if (book.tocUrl.isEmpty()) { if (book.tocUrl.isEmpty()) {
loadBookInfo(book) loadBookInfo(book)
} else if (isImportBookOnLine) { } else if (isImportBookOnLine) {

Loading…
Cancel
Save