From c20cd5cf016865d9d42ef7b0eec8e7ec883aa44f Mon Sep 17 00:00:00 2001 From: jeffvli Date: Sat, 5 Mar 2022 02:52:48 -0800 Subject: [PATCH] Fix clearing the playqueue from contextmenu (#248) --- src/components/shared/ContextMenu.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/shared/ContextMenu.tsx b/src/components/shared/ContextMenu.tsx index 57e685a..256939d 100644 --- a/src/components/shared/ContextMenu.tsx +++ b/src/components/shared/ContextMenu.tsx @@ -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 }));