瀏覽代碼

Consider sort direction when resuming (fixes #4909)

arkon 4 年之前
父節點
當前提交
8882cd4787
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt

+ 6 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt

@@ -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 }
+        }
     }
 
     /**