fix/manga_screen_missing_source_toast (#288)
This commit is contained in:
@@ -140,7 +140,11 @@ const MangaDetails: React.FC<IProps> = ({ manga }) => {
|
|||||||
|
|
||||||
const classes = useStyles(manga.inLibrary)();
|
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 = () => {
|
const addToLibrary = () => {
|
||||||
mutate(`/api/v1/manga/${manga.id}/?onlineFetch=false`, { ...manga, inLibrary: true }, { revalidate: false });
|
mutate(`/api/v1/manga/${manga.id}/?onlineFetch=false`, { ...manga, inLibrary: true }, { revalidate: false });
|
||||||
|
|||||||
Reference in New Issue
Block a user