Handle chapter read status in correct order

Fixes #9687

(cherry picked from commit 1e3d9a00f2366919430a8077ad79808c8514d793)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt
This commit is contained in:
arkon 2023-07-09 09:54:05 -04:00 committed by Jobobby04
parent 9a90a00651
commit 05a88dd6de

View File

@ -617,15 +617,6 @@ class ReaderViewModel(
readerChapter.requestedPage = pageIndex
readerChapter.chapter.last_page_read = pageIndex
updateChapter.await(
ChapterUpdate(
id = readerChapter.chapter.id!!,
read = readerChapter.chapter.read,
bookmark = readerChapter.chapter.bookmark,
lastPageRead = readerChapter.chapter.last_page_read.toLong(),
),
)
if (readerChapter.pages?.lastIndex == pageIndex) {
readerChapter.chapter.read = true
// SY -->
@ -646,6 +637,15 @@ class ReaderViewModel(
updateTrackChapterRead(readerChapter)
deleteChapterIfNeeded(readerChapter)
}
updateChapter.await(
ChapterUpdate(
id = readerChapter.chapter.id!!,
read = readerChapter.chapter.read,
bookmark = readerChapter.chapter.bookmark,
lastPageRead = readerChapter.chapter.last_page_read.toLong(),
),
)
}
}