Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Aug 25, 2024
1 parent ed2ab8e commit ab519d6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import java.io.File
import java.io.FileInputStream
import java.io.FileNotFoundException
import java.io.FileOutputStream
import kotlin.math.max

/**
* 阅读界面数据处理
Expand Down Expand Up @@ -114,8 +113,9 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
return
}
ReadBook.upMsg(null)
val maxChapterSize = max(0, ReadBook.simulatedChapterSize - 1)
if (ReadBook.durChapterIndex > maxChapterSize) {
val simulatedChapterSize = ReadBook.simulatedChapterSize
val maxChapterSize = simulatedChapterSize - 1
if (simulatedChapterSize > 0 && ReadBook.durChapterIndex > maxChapterSize) {
ReadBook.durChapterIndex = maxChapterSize
}
if (!isSameBook) {
Expand Down

0 comments on commit ab519d6

Please sign in to comment.