diff --git a/webUI/react/src/screens/Manga.tsx b/webUI/react/src/screens/Manga.tsx index c43e523..e2f05c2 100644 --- a/webUI/react/src/screens/Manga.tsx +++ b/webUI/react/src/screens/Manga.tsx @@ -58,6 +58,7 @@ export default function Manga() { const [manga, setManga] = useState(); const [chapters, setChapters] = useState([]); + const [fetchedChapters, setFetchedChapters] = useState(false); const [chapterUpdateTriggerer, setChapterUpdateTriggerer] = useState(0); function triggerChaptersUpdate() { @@ -79,7 +80,8 @@ export default function Manga() { const shouldFetchOnline = chapters.length > 0 && chapterUpdateTriggerer === 0; client.get(`/api/v1/manga/${id}/chapters?onlineFetch=${shouldFetchOnline}`) .then((response) => response.data) - .then((data) => setChapters(data)); + .then((data) => setChapters(data)) + .then(() => setFetchedChapters(true)); }, [chapters.length, chapterUpdateTriggerer]); // const itemContent = (index:any) => ; @@ -99,7 +101,7 @@ export default function Manga() { /> 0} + shouldRender={chapters.length > 0 || fetchedChapters} >