Filter out duplicated genres in manga page

This commit is contained in:
schroda
2026-06-06 18:52:24 +02:00
parent 646907fa19
commit 8d95e7c864

View File

@@ -23,6 +23,7 @@ import type {
MangaSourceIdInfo, MangaSourceIdInfo,
} from '@/features/manga/Manga.types.ts'; } from '@/features/manga/Manga.types.ts';
import { SearchLink } from '@/features/manga/components/details/SearchLink.tsx'; import { SearchLink } from '@/features/manga/components/details/SearchLink.tsx';
import uniq from 'lodash/fp/uniq';
const OPEN_CLOSE_BUTTON_HEIGHT = '35px'; const OPEN_CLOSE_BUTTON_HEIGHT = '35px';
const DESCRIPTION_COLLAPSED_SIZE = 75; const DESCRIPTION_COLLAPSED_SIZE = 75;
@@ -46,7 +47,7 @@ export const DescriptionGenre = ({
const collapsedSize = description const collapsedSize = description
? Math.min(DESCRIPTION_COLLAPSED_SIZE, descriptionHeight ?? DESCRIPTION_COLLAPSED_SIZE) ? Math.min(DESCRIPTION_COLLAPSED_SIZE, descriptionHeight ?? DESCRIPTION_COLLAPSED_SIZE)
: 0; : 0;
const genres = useMemo(() => mangaGenres.filter(Boolean), [mangaGenres]); const genres = useMemo(() => uniq(mangaGenres.filter(Boolean)), [mangaGenres]);
return ( return (
<> <>