Skip to content

Commit

Permalink
bugfix remove genres that are undefined from search player component
Browse files Browse the repository at this point in the history
  • Loading branch information
antiantivirus committed Sep 9, 2024
1 parent 5728c23 commit 3a05fd5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/showPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ export function ShowPreviewWithoutPlayer({
fields: { genres, coverImage, title, slug, date },
}: TypeShow) {
const parsedGenres = parseGenres({
items: genres.map((genre) => ({
name: genre.fields.name,
sys: { id: genre.sys.id },
})),
items: genres
.filter((genre) => genre.fields)
.map((genre) => ({
name: genre.fields.name,
sys: { id: genre.sys.id },
})),
}).slice(0, 3);

return (
Expand Down

0 comments on commit 3a05fd5

Please sign in to comment.