diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt index e6090b873..443543bc4 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt @@ -42,6 +42,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } else { App.db.bookDao().lastReadBook } + saveRead(book) book?.let { durChapterIndex = book.durChapterIndex durPageIndex = book.durChapterPos @@ -235,9 +236,9 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { chapterListFinish.postValue(true) } - fun saveRead() { + fun saveRead(book: Book? = bookData.value) { execute { - bookData.value?.let { book -> + book?.let { book -> book.lastCheckCount = 0 book.durChapterTime = System.currentTimeMillis() book.durChapterIndex = durChapterIndex