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

@@ -1,7 +1,7 @@
import GradientScrollView from '@app/components/GradientScrollView'
import ListItem from '@app/components/ListItem'
import NowPlayingBar from '@app/components/NowPlayingBar'
import { mapTrackExtToSong, useIsPlaying, useSkipTo } from '@app/hooks/trackplayer'
import { mapTrackExtToSong, useSkipTo } from '@app/hooks/trackplayer'
import { useStore } from '@app/state/store'
import { selectTrackPlayer } from '@app/state/trackplayer'
import React from 'react'
@@ -10,7 +10,6 @@ import { StyleSheet, View } from 'react-native'
const NowPlayingQueue = React.memo<{}>(() => {
const queue = useStore(selectTrackPlayer.queue)
const skipTo = useSkipTo()
const isPlaying = useIsPlaying()
return (
<View style={styles.outerContainer}>
@@ -20,7 +19,7 @@ const NowPlayingQueue = React.memo<{}>(() => {
<ListItem
key={i}
item={song}
isPlaying={() => isPlaying(undefined, i)}
queueId={i}
onPress={() => skipTo(i)}
showArt={true}
subtitle={`${song.artist}${song.album}`}