From 4c6e9a8aa128f0a338ac48edc5456a018b5618cf Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sun, 29 Oct 2023 13:15:17 +0100 Subject: [PATCH] Do not add mangas to the default category (#433) 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 --- src/components/manga/MangaDetails.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/manga/MangaDetails.tsx b/src/components/manga/MangaDetails.tsx index 1cbb3b88..cb7cd196 100644 --- a/src/components/manga/MangaDetails.tsx +++ b/src/components/manga/MangaDetails.tsx @@ -169,7 +169,9 @@ export const MangaDetails: React.FC = ({ 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(() => {