diff --git a/front/components/V2/SearchBar.tsx b/front/components/V2/SearchBar.tsx index 961e4b1..4b9cf72 100644 --- a/front/components/V2/SearchBar.tsx +++ b/front/components/V2/SearchBar.tsx @@ -156,7 +156,13 @@ const SearchBarComponent = (props: { onValidate: (searchData: searchProps) => vo key={index} name={artist.name} onPress={() => { - props.onValidate({artist: artist.id, genre: genresQuery.data?.find((g) => g.name === genre)?.id ?? undefined, query: query}) + props.onValidate({ + artist: artist.id, + genre: + genresQuery.data?.find((g) => g.name === genre) + ?.id ?? undefined, + query: query, + }); setArtist(artist.name); }} /> diff --git a/front/views/V2/SearchView.tsx b/front/views/V2/SearchView.tsx index a15fabf..0171e8e 100644 --- a/front/views/V2/SearchView.tsx +++ b/front/views/V2/SearchView.tsx @@ -10,7 +10,6 @@ import SearchHistory from '../../components/V2/SearchHistory'; import ScaffoldCC from '../../components/UI/ScaffoldCC'; import MusicItem from '../../components/UI/MusicItem'; import API from '../../API'; -import { useMutation } from 'react-query'; import LoadingComponent from '../../components/Loading'; import ErrorView from '../ErrorView'; import { useLikeSongMutation } from '../../utils/likeSongMutation'; @@ -100,7 +99,7 @@ const SearchView = (props: RouteProps<{}>) => { const likedSongs = useQuery(API.getLikedSongs()); const { mutateAsync } = useLikeSongMutation(); - let result: any[] = [];; + let result: any[] = []; if (userQuery.isLoading || likedSongs.isLoading || artistsQuery.isLoading) { return ; @@ -121,10 +120,10 @@ const SearchView = (props: RouteProps<{}>) => { level: song?.difficulties.chordcomplexity, lastScore: song?.lastScore, bestScore: song?.bestScore, - liked: likedSongs.data?.some(x => x.songId == song.id) ?? false, + liked: likedSongs.data?.some((x) => x.songId == song.id) ?? false, onLike: () => { - mutateAsync({ songId: song.id, like: false }).then(() => likedSongs.refetch()); - }, + mutateAsync({ songId: song.id, like: false }).then(() => likedSongs.refetch()); + }, onPlay: () => navigation.navigate('Play', { songId: song.id }), })) ?? []; }