1
0
Fork 0
mirror of https://github.com/mihonapp/mihon.git synced 2025-03-08 15:35:42 +03:00

Consider sort direction when resuming (fixes )

This commit is contained in:
arkon 2021-04-21 17:38:46 -04:00
parent 6676490e09
commit 8882cd4787

View file

@ -474,7 +474,12 @@ class MangaPresenter(
* Returns the next unread chapter or null if everything is read.
*/
fun getNextUnreadChapter(): ChapterItem? {
return chapters.sortedWith(getChapterSort()).findLast { !it.read }
val chapters = chapters.sortedWith(getChapterSort())
return if (sortDescending()) {
return chapters.findLast { !it.read }
} else {
chapters.find { !it.read }
}
}
/**