From ec3fe5ab42691902269e73e19a8effe845245f08 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Tue, 27 Sep 2022 09:03:43 +0800 Subject: [PATCH] fix: ReadBook.durChapterIndex not changed when book.durChapterIndex change fix https://github.com/gedoor/legado/issues/2338 --- .../main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 3 +++ 1 file changed, 3 insertions(+) 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 bfa935cd7..e33bb5718 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 @@ -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 {