pretty tsc lint
This commit is contained in:
@@ -156,7 +156,13 @@ const SearchBarComponent = (props: { onValidate: (searchData: searchProps) => vo
|
|||||||
key={index}
|
key={index}
|
||||||
name={artist.name}
|
name={artist.name}
|
||||||
onPress={() => {
|
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);
|
setArtist(artist.name);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import SearchHistory from '../../components/V2/SearchHistory';
|
|||||||
import ScaffoldCC from '../../components/UI/ScaffoldCC';
|
import ScaffoldCC from '../../components/UI/ScaffoldCC';
|
||||||
import MusicItem from '../../components/UI/MusicItem';
|
import MusicItem from '../../components/UI/MusicItem';
|
||||||
import API from '../../API';
|
import API from '../../API';
|
||||||
import { useMutation } from 'react-query';
|
|
||||||
import LoadingComponent from '../../components/Loading';
|
import LoadingComponent from '../../components/Loading';
|
||||||
import ErrorView from '../ErrorView';
|
import ErrorView from '../ErrorView';
|
||||||
import { useLikeSongMutation } from '../../utils/likeSongMutation';
|
import { useLikeSongMutation } from '../../utils/likeSongMutation';
|
||||||
@@ -100,7 +99,7 @@ const SearchView = (props: RouteProps<{}>) => {
|
|||||||
const likedSongs = useQuery(API.getLikedSongs());
|
const likedSongs = useQuery(API.getLikedSongs());
|
||||||
const { mutateAsync } = useLikeSongMutation();
|
const { mutateAsync } = useLikeSongMutation();
|
||||||
|
|
||||||
let result: any[] = [];;
|
let result: any[] = [];
|
||||||
|
|
||||||
if (userQuery.isLoading || likedSongs.isLoading || artistsQuery.isLoading) {
|
if (userQuery.isLoading || likedSongs.isLoading || artistsQuery.isLoading) {
|
||||||
return <LoadingComponent />;
|
return <LoadingComponent />;
|
||||||
@@ -121,10 +120,10 @@ const SearchView = (props: RouteProps<{}>) => {
|
|||||||
level: song?.difficulties.chordcomplexity,
|
level: song?.difficulties.chordcomplexity,
|
||||||
lastScore: song?.lastScore,
|
lastScore: song?.lastScore,
|
||||||
bestScore: song?.bestScore,
|
bestScore: song?.bestScore,
|
||||||
liked: likedSongs.data?.some(x => x.songId == song.id) ?? false,
|
liked: likedSongs.data?.some((x) => x.songId == song.id) ?? false,
|
||||||
onLike: () => {
|
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 }),
|
onPlay: () => navigation.navigate('Play', { songId: song.id }),
|
||||||
})) ?? [];
|
})) ?? [];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user