Fix Mark previous as read (#7396)

This commit is contained in:
AntsyLich 2022-06-27 19:37:30 +06:00 committed by GitHub
parent ef3acb8c43
commit 7440086ef1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -519,7 +519,7 @@ class MangaPresenter(
fun markPreviousChapterRead(pointer: DomainChapter) { fun markPreviousChapterRead(pointer: DomainChapter) {
val successState = successState ?: return val successState = successState ?: return
val chapters = successState.chapters.map { it.chapter } val chapters = processedChapters.orEmpty().map { it.chapter }.toList()
val prevChapters = if (successState.manga.sortDescending()) chapters.asReversed() else chapters val prevChapters = if (successState.manga.sortDescending()) chapters.asReversed() else chapters
val pointerPos = prevChapters.indexOf(pointer) val pointerPos = prevChapters.indexOf(pointer)
if (pointerPos != -1) markChaptersRead(prevChapters.take(pointerPos), true) if (pointerPos != -1) markChaptersRead(prevChapters.take(pointerPos), true)