From 3ee6ac605dc3eb735b0999fa580c7c885eebbdb9 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Sun, 14 Apr 2024 08:55:10 +0300 Subject: [PATCH] Fix current chapter download #840 --- .../org/koitharu/kotatsu/details/ui/DownloadDialogHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/DownloadDialogHelper.kt b/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/DownloadDialogHelper.kt index 112382d2f..7fa8ef877 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/DownloadDialogHelper.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/details/ui/DownloadDialogHelper.kt @@ -28,7 +28,7 @@ class DownloadDialogHelper( } if (history != null) { - val unreadChapters = branchChapters.takeLastWhile { it.id != history.chapterId } + val unreadChapters = branchChapters.dropWhile { it.id != history.chapterId } if (unreadChapters.isNotEmpty() && unreadChapters.size < branchChapters.size) { add(DownloadOption.AllUnreadChapters(unreadChapters.ids(), branch)) if (unreadChapters.size > 5) {