From dd6b0a1e44a1ff63e330b9dd61fc747ca3cef588 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Thu, 27 Jun 2024 15:09:13 +0200 Subject: [PATCH] Show error for chapter without pages --- public/locales/en.json | 1 + src/screens/Reader.tsx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/public/locales/en.json b/public/locales/en.json index 8a5a32f9..437e1db7 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -734,6 +734,7 @@ "error": { "label": { "next_chapter_does_not_exist": "There is no next chapter to open", + "no_pages_found": "No pages found", "prev_chapter_does_not_exist": "There is no previous chapter to open" } }, diff --git a/src/screens/Reader.tsx b/src/screens/Reader.tsx index 96816246..18f41ad4 100644 --- a/src/screens/Reader.tsx +++ b/src/screens/Reader.tsx @@ -503,6 +503,10 @@ export function Reader() { ); } + if (!chapter.pageCount) { + return ; + } + const pages = range(chapter.pageCount).map((index) => ({ index, src: requestManager.getChapterPageUrl(mangaId, chapterIndex, index),