Feature/add option to remove manga from categories when removing from library (#633)

* Optionally remove manga categories when removing them from library

* Use "Mangas::removeFromLibrary"

* Handle uncatched promises
This commit is contained in:
schroda
2024-03-02 15:28:58 +01:00
committed by GitHub
parent c5a5c4b8af
commit 8bdf035ca7
12 changed files with 65 additions and 13 deletions

View File

@@ -229,11 +229,7 @@ export const MangaDetails: React.FC<IProps> = ({ manga }) => {
};
const removeFromLibrary = () => {
Promise.all([requestManager.updateManga(manga.id, { updateManga: { inLibrary: false } }).response])
.then(() => makeToast(t('library.info.label.removed_from_library'), 'success'))
.catch(() => {
makeToast(t('library.error.label.remove_from_library'), 'error');
});
Mangas.removeFromLibrary([manga.id]).catch(defaultPromiseErrorHandler('MangaDetails::removeFromLibrary'));
};
return (