diff --git a/src/screens/manga/SourceMangas.tsx b/src/screens/manga/SourceMangas.tsx index dc878b46..2a232382 100644 --- a/src/screens/manga/SourceMangas.tsx +++ b/src/screens/manga/SourceMangas.tsx @@ -22,9 +22,10 @@ export default function SourceMangas(props: { popular: boolean }) { const [mangas, setMangas] = useState([]); const [hasNextPage, setHasNextPage] = useState(false); const [lastPageNum, setLastPageNum] = useState(1); + const [fetched, setFetched] = useState(false); useEffect(() => { - setTitle('Source'); // title is deligated to `MangaGrid` but we set it here once + setTitle('Source'); // title is later set after a fetch but we set it here once }, []); useEffect(() => { @@ -49,7 +50,7 @@ export default function SourceMangas(props: { popular: boolean }) { client.get(`/api/v1/source/${sourceId}`) .then((response) => response.data) .then((data: ISource) => { - setTitle(data.name); + setTitle(data.displayName); setIsConfigurable(data.isConfigurable); }); }, []); @@ -65,15 +66,20 @@ export default function SourceMangas(props: { popular: boolean }) { title: it.title, thumbnailUrl: it.thumbnailUrl, id: it.id, }))]); setHasNextPage(data.hasNextPage); + setFetched(true); }); }, [lastPageNum]); + let message; + if (fetched) message = 'No manga was found!'; + return ( ); }