Fix/library manga selection type error (#566)

* Prevent TypeError when deselecting items from a specific key

This was noticed when changing the categories of a manga to a category without any selected mangas, in this case, when trying to deselect a manga after changing the categories, a TypeError was thrown which resulted in a white screen

* Remove duplicates from the list of all selected ids

* Update state via setter

* Clear selection after disabling the library selection mode

* Remove console log
This commit is contained in:
schroda
2024-01-21 22:31:43 +01:00
committed by GitHub
parent 69a62b6c2c
commit dcbf5a1899
3 changed files with 16 additions and 4 deletions

View File

@@ -69,7 +69,6 @@ export const MangaActionMenuItems = ({
};
const performAction = (action: MangaAction, mangas: TManga[]) => {
console.log('MangaActionMenuItem', manga);
Mangas.performAction(action, manga ? [manga.id] : Mangas.getIds(mangas), {
wasManuallyMarkedAsRead: true,
}).catch(defaultPromiseErrorHandler(`MangaActionMenuItems:performAction(${action})`));