diff --git a/src/components/manga/MangaDetails.tsx b/src/components/manga/MangaDetails.tsx index abe05d96..4bd891c3 100644 --- a/src/components/manga/MangaDetails.tsx +++ b/src/components/manga/MangaDetails.tsx @@ -135,9 +135,7 @@ export default function MangaDetails(props: IProps) { const { setAction } = useContext(NavbarContext); const { manga } = props; - if (manga.genre == null) { - manga.genre = ''; - } + const [inLibrary, setInLibrary] = useState( manga.inLibrary ? 'In Library' : 'Add To Library', ); @@ -249,7 +247,7 @@ export default function MangaDetails(props: IProps) {

{manga.description}

- {manga.genre.split(', ').map((g) =>
{g}
)} + {manga.genre?.split(', ').map((g) =>
{g}
)}
diff --git a/src/typings.d.ts b/src/typings.d.ts index f996c978..fc7bee6b 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -46,7 +46,7 @@ interface IManga { artist: string author: string description: string - genre: string + genre: string | null status: string inLibrary: boolean