Fixed history showing the wrong chapter when multiple entries have the same manga on the first paginated result

An extra fix to 80732700fc
This commit is contained in:
Jays2Kings 2023-03-05 13:02:14 -05:00
parent 3729c67244
commit 7ed2ad4aad

View file

@ -271,10 +271,11 @@ class RecentsPresenter(
(it.chapter.read && !viewType.isUpdates) || it.chapter.id == null -> {
val unreadChapterIsAlreadyInList by lazy {
val fIndex = mangaList.indexOfFirst { item -> item.manga.id == it.manga.id }
recentItems.any { item -> item.mch.manga.id == it.manga.id } ||
fIndex < mangaList.indexOf(it)
(
updatePageCount && recentItems.any { item -> item.mch.manga.id == it.manga.id }
) || fIndex < mangaList.indexOf(it)
}
if (viewType.isHistory && updatePageCount && unreadChapterIsAlreadyInList) {
if (viewType.isHistory && unreadChapterIsAlreadyInList) {
it.chapter
} else {
val nextChapter = getNextChapter(it.manga)