优化
Some checks failed
Test Build / prepare (push) Has been cancelled
Test Build / build (app, release) (push) Has been cancelled
Test Build / build (app, releaseA) (push) Has been cancelled
Test Build / prerelease (push) Has been cancelled
Test Build / lanzou (push) Has been cancelled
Test Build / test_Branch (push) Has been cancelled
Test Build / telegram (push) Has been cancelled

This commit is contained in:
Horis
2025-03-24 16:35:42 +08:00
parent 3697bfb96d
commit 7f381174cf
4 changed files with 7 additions and 9 deletions

View File

@@ -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)
}
}
}

View File

@@ -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()
}
}

View File

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

View File

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