fix: also play tracks with index 0
This commit is contained in:
@@ -150,7 +150,7 @@ const TrackListView: React.FC<TrackListViewProps> = ({
|
|||||||
const shuffleEntity = useCallback(() => { playTracks(trackIds, { shuffle: true }); }, [playTracks, trackIds]);
|
const shuffleEntity = useCallback(() => { playTracks(trackIds, { shuffle: true }); }, [playTracks, trackIds]);
|
||||||
const selectTrack = useCallback(async (trackId: string) => {
|
const selectTrack = useCallback(async (trackId: string) => {
|
||||||
const index = trackIds.findIndex((id) => id === trackId);
|
const index = trackIds.findIndex((id) => id === trackId);
|
||||||
if (index) {
|
if (index >= 0) {
|
||||||
await playTracks(trackIds, { playIndex: index });
|
await playTracks(trackIds, { playIndex: index });
|
||||||
}
|
}
|
||||||
}, [playTracks, trackIds]);
|
}, [playTracks, trackIds]);
|
||||||
|
|||||||
Reference in New Issue
Block a user