diff --git a/src/hooks/persisted/useNovel.ts b/src/hooks/persisted/useNovel.ts index 43d03013c..bdafb7815 100644 --- a/src/hooks/persisted/useNovel.ts +++ b/src/hooks/persisted/useNovel.ts @@ -351,7 +351,7 @@ export const useNovel = (novelPath: string, pluginId: string) => { novelSettings.filter, page, ); - if (!chapters.length) { + if (!chapters.length && Number(page)) { const sourcePage = await fetchPage(pluginId, novelPath, page); const sourceChapters = sourcePage.chapters.map(ch => { return { @@ -368,14 +368,14 @@ export const useNovel = (novelPath: string, pluginId: string) => { ); } setChapters(chapters); - setLoading(false); } + setLoading(false); }, [novel, novelSettings, pageIndex]); useEffect(() => { getNovel(); }, []); useEffect(() => { - getChapters(); + getChapters().catch(e => showToast(e.message)); }, [getChapters]); return { diff --git a/src/screens/novel/components/Info/NovelInfoHeader.tsx b/src/screens/novel/components/Info/NovelInfoHeader.tsx index 3e6dd7905..9cfe35c92 100644 --- a/src/screens/novel/components/Info/NovelInfoHeader.tsx +++ b/src/screens/novel/components/Info/NovelInfoHeader.tsx @@ -213,7 +213,7 @@ const NovelInfoHeader = ({ {`${chapters?.length} ${getString('novelScreen.chapters')}`} - {page ? ( + {page && Number(page) ? (