Эх сурвалжийг харах

Show toast when no next chapter found in library

Closes #8522
Will probably become a snackbar at some point.
arkon 2 жил өмнө
parent
commit
db6528d3fa

+ 6 - 3
app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt

@@ -30,6 +30,7 @@ import eu.kanade.tachiyomi.ui.manga.MangaController
 import eu.kanade.tachiyomi.ui.reader.ReaderActivity
 import eu.kanade.tachiyomi.util.lang.launchIO
 import eu.kanade.tachiyomi.util.lang.launchUI
+import eu.kanade.tachiyomi.util.lang.withUIContext
 import eu.kanade.tachiyomi.util.system.toast
 import kotlinx.coroutines.cancel
 
@@ -193,16 +194,18 @@ class LibraryController(
     }
 
     private fun openManga(mangaId: Long) {
-        // Notify the presenter a manga is being opened.
         presenter.onOpenManga()
-
         router.pushController(MangaController(mangaId))
     }
 
     private fun continueReading(libraryManga: LibraryManga) {
         viewScope.launchIO {
             val chapter = presenter.getNextUnreadChapter(libraryManga.manga)
-            if (chapter != null) openChapter(chapter)
+            if (chapter != null) {
+                openChapter(chapter)
+            } else {
+                withUIContext { activity?.toast(R.string.no_next_chapter) }
+            }
         }
     }