feat(track): play-on-hover cover art, replacing double-click
Add a play overlay button shown on cover art hover that inserts the track into the queue right after the current track and jumps to it, so it takes priority over what's already queued. Replaces the double-click-to-play interaction with a new playNow queue action.
This commit is contained in:
@@ -59,6 +59,11 @@ export const queueSlice = createSlice({
|
||||
addNextInQueue(state, action: PayloadAction<QueueEntry>) {
|
||||
state.entries.splice(state.currentIndex + 1, 0, action.payload);
|
||||
},
|
||||
playNow(state, action: PayloadAction<QueueEntry>) {
|
||||
const insertAt = state.currentIndex + 1;
|
||||
state.entries.splice(insertAt, 0, action.payload);
|
||||
state.currentIndex = insertAt;
|
||||
},
|
||||
removeFromQueue(state, action: PayloadAction<number>) {
|
||||
state.entries.splice(action.payload, 1);
|
||||
if (action.payload < state.currentIndex) state.currentIndex--;
|
||||
@@ -93,6 +98,7 @@ export const {
|
||||
setQueue,
|
||||
addToQueue,
|
||||
addNextInQueue,
|
||||
playNow,
|
||||
removeFromQueue,
|
||||
moveInQueue,
|
||||
goToIndex,
|
||||
|
||||
Reference in New Issue
Block a user