Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Fix clearing the playqueue from contextmenu (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffvli committed Mar 5, 2022
1 parent 9c9b293 commit c20cd5c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/shared/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,14 @@ export const GlobalContextMenu = () => {

const handleRemoveSelected = async () => {
if (misc.contextMenu.type === 'nowPlaying') {
dispatch(removeFromPlayQueue({ entries: multiSelect.selected }));
if (playQueue.currentPlayer === 1) {
dispatch(fixPlayer2Index());
if (multiSelect.selected.length === playQueue.entry.length) {
dispatch(clearPlayQueue());
dispatch(setStatus('PAUSED'));
} else {
dispatch(removeFromPlayQueue({ entries: multiSelect.selected }));
if (playQueue.currentPlayer === 1) {
dispatch(fixPlayer2Index());
}
}
} else {
dispatch(removeFromPlaylist({ selectedEntries: multiSelect.selected }));
Expand Down

0 comments on commit c20cd5c

Please sign in to comment.