Browse Source

fix: ReadBook.durChapterIndex not changed when book.durChapterIndex change

fix https://github.com/gedoor/legado/issues/2338
Xwite 4 years ago
parent
commit
cfd9fa90ad
1 changed files with 3 additions and 0 deletions
  1. 3 0
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

+ 3 - 0
app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@@ -85,7 +85,10 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
         } else if (isSameBook) {
             if (ReadBook.curTextChapter != null) {
                 ReadBook.callBack?.upContent(resetPageOffset = false)
+            } else if(ReadBook.durChapterIndex == book.durChapterIndex) {
+                ReadBook.loadContent(resetPageOffset = true)
             } else {
+                ReadBook.durChapterIndex = book.durChapterIndex
                 ReadBook.loadContent(resetPageOffset = true)
             }
         } else {