From d522d6d545bfbd4e4f8f60975bddcd5f6bcc69ac Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 12 Feb 2023 16:03:24 -0500 Subject: [PATCH] Avoid preload download check if chapter is already loaded or loading Maybe fixes #8953, #9060 --- .../java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt index a9d31c21c..3498f1745 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt @@ -365,6 +365,10 @@ class ReaderViewModel( * that the user doesn't have to wait too long to continue reading. */ private suspend fun preload(chapter: ReaderChapter) { + if (chapter.state is ReaderChapter.State.Loaded || chapter.state == ReaderChapter.State.Loading) { + return + } + if (chapter.pageLoader is HttpPageLoader) { val manga = manga ?: return val dbChapter = chapter.chapter