fix duplicate songs showing as playing

made playing icon in line with text (doesn't work well with scaling)
This commit is contained in:
austinried
2021-08-10 17:33:07 +09:00
parent 2c0fdfed4d
commit ea45678733
6 changed files with 42 additions and 15 deletions
+3 -1
View File
@@ -3,7 +3,7 @@ import Header from '@app/components/Header'
import ListItem from '@app/components/ListItem'
import NothingHere from '@app/components/NothingHere'
import { useActiveListRefresh2 } from '@app/hooks/server'
import { useSetQueue } from '@app/hooks/trackplayer'
import { useIsPlaying, useSetQueue } from '@app/hooks/trackplayer'
import { ListableItem, SearchResults, Song } from '@app/models/music'
import { selectMusic } from '@app/state/music'
import { useStore } from '@app/state/store'
@@ -15,10 +15,12 @@ import { ActivityIndicator, StatusBar, StyleSheet, TextInput, View } from 'react
const SongItem = React.memo<{ item: Song }>(({ item }) => {
const setQueue = useSetQueue()
const isPlaying = useIsPlaying()
return (
<ListItem
item={item}
isPlaying={() => isPlaying(item.id, 0)}
showArt={true}
showStar={false}
onPress={() => setQueue([item], item.title, 'song', item.id, 0)}