mirror of
https://github.com/jeffvli/feishin.git
synced 2026-08-09 05:42:57 +02:00
revalidate current song in queue during playback
This commit is contained in:
@@ -2641,6 +2641,20 @@ export const incrementQueuePlayCount = (ids: string[]) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const updateQueueSong = (songId: string, updatedSong: Song) => {
|
||||
usePlayerStoreBase.setState((state) => {
|
||||
Object.values(state.queue.songs).forEach((song) => {
|
||||
if (song.id === songId) {
|
||||
const uniqueId = song._uniqueId;
|
||||
state.queue.songs[song._uniqueId] = {
|
||||
...updatedSong,
|
||||
_uniqueId: uniqueId,
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export const usePlayerMuted = () => {
|
||||
return usePlayerStoreBase((state) => state.player.muted);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user