Skip to content

Commit

Permalink
Do not add mangas to the default category (#433)
Browse files Browse the repository at this point in the history
The default category is used as a fallback and should never be actually mapped to mangas in the database.
However, when using the update manga category mutation the server still creates this mapping, which then leads to issues with getting mangas for the default category
  • Loading branch information
schroda authored Oct 29, 2023
1 parent 678df88 commit 4c6e9a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/manga/MangaDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ export const MangaDetails: React.FC<IProps> = ({ manga }) => {
const { t } = useTranslation();
const { data: categoriesData, loading: areCategoriesLoading } = requestManager.useGetCategories();
const categories = categoriesData?.categories.nodes ?? [];
const defaultCategoryIds = categories.filter((category) => category.default).map((category) => category.id);
const defaultCategoryIds = categories
.filter((category) => category.default && category.id !== 0)
.map((category) => category.id);
const [updateMangaCategories] = requestManager.useUpdateMangaCategories();

useEffect(() => {
Expand Down

0 comments on commit 4c6e9a8

Please sign in to comment.