Преглед на файлове

Avoid preload download check if chapter is already loaded or loading

Maybe fixes #8953, #9060

(cherry picked from commit d522d6d545bfbd4e4f8f60975bddcd5f6bcc69ac)
arkon преди 2 години
родител
ревизия
0ea3ac9807
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt

+ 4 - 0
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