mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 06:52:43 +01:00
impl star/unstar starred state
This commit is contained in:
@@ -38,6 +38,21 @@ export const usePlaylistWithSongs = (id: string) => {
|
||||
return playlist
|
||||
}
|
||||
|
||||
export const useStarred = (id: string, type: string) => {
|
||||
const starred = useStore(
|
||||
useCallback(
|
||||
(state: Store) => {
|
||||
if (!(type in state.starred)) {
|
||||
return false
|
||||
}
|
||||
return !!state.starred[type][id]
|
||||
},
|
||||
[type, id],
|
||||
),
|
||||
)
|
||||
return starred
|
||||
}
|
||||
|
||||
export const useCoverArtUri = () => {
|
||||
const server = useStore(selectSettings.activeServer)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user