From c4c4361ff9d914c4cb03294a9b1dabb538148254 Mon Sep 17 00:00:00 2001 From: Arthur Jamet <60505370+Arthi-chaud@users.noreply.github.com> Date: Thu, 8 Jun 2023 10:53:32 +0100 Subject: [PATCH] Front: HomeView: Fix bad argument to song card (#216) --- front/views/HomeView.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/views/HomeView.tsx b/front/views/HomeView.tsx index 1c49767..6c2e27c 100644 --- a/front/views/HomeView.tsx +++ b/front/views/HomeView.tsx @@ -98,14 +98,14 @@ const HomeView = () => { } songs={songHistory - .filter((songQuery) => songQuery.data) .map(({ data }) => data) + .filter((data): data is Song => data !== undefined) .filter((song, i, array) => array.map((s) => s.id).findIndex((id) => id == song.id) == i) .filter((song) => artistsQueries.find((artistQuery) => artistQuery.data?.id === song.artistId)) .map((song) => ({ cover: song.cover, name: song.name, - id: song.id, + songId: song.id, artistName: artistsQueries.find((artistQuery) => artistQuery.data?.id === song.artistId)!.data!.name })) ?? [] }