fix current idx not being set on toggle shuffle

switch to passing params instead of function
This commit is contained in:
austinried
2021-08-11 14:46:30 +09:00
parent 9fda955df6
commit f6ecc0bf40
7 changed files with 47 additions and 38 deletions

View File

@@ -5,7 +5,7 @@ import ListItem from '@app/components/ListItem'
import ListPlayerControls from '@app/components/ListPlayerControls'
import NothingHere from '@app/components/NothingHere'
import { useAlbumWithSongs, useCoverArtUri, usePlaylistWithSongs } from '@app/hooks/music'
import { useIsPlaying, useSetQueue } from '@app/hooks/trackplayer'
import { useSetQueue } from '@app/hooks/trackplayer'
import { AlbumWithSongs, PlaylistWithSongs, Song } from '@app/models/music'
import colors from '@app/styles/colors'
import font from '@app/styles/font'
@@ -28,7 +28,6 @@ const Songs = React.memo<{
itemId: string
}>(({ songs, name, type, itemId }) => {
const setQueue = useSetQueue()
const isPlaying = useIsPlaying()
const _songs = [...songs]
let typeName = ''
@@ -57,7 +56,8 @@ const Songs = React.memo<{
<ListItem
key={i}
item={s}
isPlaying={() => isPlaying(itemId, i)}
contextId={itemId}
queueId={i}
subtitle={s.artist}
onPress={() => setQueue(songs, name, type, itemId, i)}
showArt={type === 'playlist'}