Follow chapter sort setting for start/resume FAB (closes #1716)

(cherry picked from commit f7cc36f2f0)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
This commit is contained in:
arkon
2021-04-17 11:38:08 -04:00
committed by Jobobby04
parent 22b8f51fa3
commit 2220b6a91d
@@ -892,10 +892,9 @@ class MangaPresenter(
*/
fun getNextUnreadChapter(): ChapterItem? {
return if (source.isEhBasedSource()) {
val chapter = chapters.sortedBy { it.source_order }.getOrNull(0)
if (chapter?.read == false) chapter else null
chapters.sortedWith(getChapterSort()).lastOrNull()?.takeUnless { it.read }
} else {
chapters.sortedByDescending { it.source_order }.find { !it.read }
chapters.sortedWith(getChapterSort()).findLast { !it.read }
}
}