fix/manga_screen_missing_source_toast (#288)

This commit is contained in:
schroda
2023-05-02 00:35:56 +02:00
committed by GitHub
parent 548b22d211
commit 2e05e7d35c

View File

@@ -140,7 +140,11 @@ const MangaDetails: React.FC<IProps> = ({ manga }) => {
const classes = useStyles(manga.inLibrary)();
useEffect(() => makeToast(translate('source.error.label.source_not_found'), 'error'), [manga.id]);
useEffect(() => {
if (!manga.source) {
makeToast(translate('source.error.label.source_not_found'), 'error');
}
}, [manga.source]);
const addToLibrary = () => {
mutate(`/api/v1/manga/${manga.id}/?onlineFetch=false`, { ...manga, inLibrary: true }, { revalidate: false });