From 92f64ef0092e5df67836cfd8f61b399a08d5fb13 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Thu, 16 Jan 2025 14:07:21 +0100 Subject: [PATCH] Handle single page chapters for download ahead --- src/modules/reader/utils/Reader.utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/reader/utils/Reader.utils.ts b/src/modules/reader/utils/Reader.utils.ts index 7ec12721..7503b82c 100644 --- a/src/modules/reader/utils/Reader.utils.ts +++ b/src/modules/reader/utils/Reader.utils.ts @@ -104,7 +104,7 @@ export const getChapterIdsForDownloadAhead = ( } const isDownloadAheadEnabled = !!downloadAheadLimit; - const inDownloadRange = currentPageIndex / chapterUpToDateData.pageCount > 0.25; + const inDownloadRange = (currentPageIndex + 1) / chapterUpToDateData.pageCount > 0.25; const shouldCheckDownloadAhead = isDownloadAheadEnabled && chapterUpToDateData.isDownloaded && inDownloadRange; if (!shouldCheckDownloadAhead) { return [];