diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index 5ba4625bd..a23b56bb1 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -64,10 +64,17 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { ReadBook.loadContent(resetPageOffset = true) } } else { - isInitFinish = true + if (ReadBook.durChapterIndex != book.durChapterIndex) { + ReadBook.durChapterIndex = book.durChapterIndex + ReadBook.durPageIndex = book.durChapterPos + ReadBook.prevTextChapter = null + ReadBook.curTextChapter = null + ReadBook.nextTextChapter = null + } ReadBook.book!!.group = book.group ReadBook.titleDate.postValue(book.name) ReadBook.upWebBook(book) + isInitFinish = true if (!book.isLocalBook() && ReadBook.webBook == null) { autoChangeSource(book.name, book.author) return @@ -82,6 +89,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } else { if (ReadBook.curTextChapter != null) { ReadBook.callBack?.upContent(resetPageOffset = false) + } else { + ReadBook.loadContent(resetPageOffset = true) } } }