Horis 1 год назад
Родитель
Сommit
26e29039f8

+ 4 - 4
app/src/main/java/io/legado/app/model/ReadBook.kt

@@ -56,7 +56,6 @@ object ReadBook : CoroutineScope by MainScope() {
     var book: Book? = null
     var callBack: CallBack? = null
     var inBookshelf = false
-    var tocChanged = false
     var chapterSize = 0
     var simulatedChapterSize = 0
     var durChapterIndex = 0
@@ -925,9 +924,10 @@ object ReadBook : CoroutineScope by MainScope() {
             if (simulatedChapterSize > 0 && durChapterIndex > simulatedChapterSize - 1) {
                 durChapterIndex = simulatedChapterSize - 1
             }
-            clearTextChapter()
-            if (callBack != null) {
-                loadContent(false)
+            if (callBack == null) {
+                clearTextChapter()
+            } else {
+                loadContent(true)
             }
         }
     }

+ 3 - 3
app/src/main/java/io/legado/app/model/ReadManga.kt

@@ -44,7 +44,6 @@ import kotlin.math.min
 @Suppress("MemberVisibilityCanBePrivate")
 object ReadManga : CoroutineScope by MainScope() {
     var inBookshelf = false
-    var tocChanged = false
     var book: Book? = null
     val executor = globalExecutor
     var durChapterIndex = 0 //章节位置
@@ -546,8 +545,9 @@ object ReadManga : CoroutineScope by MainScope() {
             if (simulatedChapterSize > 0 && durChapterIndex > simulatedChapterSize - 1) {
                 durChapterIndex = simulatedChapterSize - 1
             }
-            clearMangaChapter()
-            if (mCallback != null) {
+            if (mCallback == null) {
+                clearMangaChapter()
+            } else {
                 loadContent()
             }
         }

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

@@ -176,7 +176,6 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
         execute {
             if (loadChapterListAwait(book)) {
                 ReadBook.upMsg(null)
-                ReadBook.loadContent(resetPageOffset = true)
             }
         }
     }

+ 0 - 1
app/src/main/java/io/legado/app/ui/book/toc/TocActivity.kt

@@ -198,7 +198,6 @@ class TocActivity : VMBaseActivity<ActivityChapterListBinding, TocViewModel>(),
             ReadBook.book?.let { readBook ->
                 if (readBook == book) {
                     ReadBook.upMsg(null)
-                    ReadBook.loadContent(resetPageOffset = true)
                 }
             }
         }