Browse Source

Fix move to bottom using index on context menu

master
jeffvli 3 years ago
committed by Jeff
parent
commit
66094283c9
  1. 7
      src/components/shared/ContextMenu.tsx

7
src/components/shared/ContextMenu.tsx

@ -439,10 +439,17 @@ export const GlobalContextMenu = () => {
const handleMoveSelectedToIndex = () => { const handleMoveSelectedToIndex = () => {
if (misc.contextMenu.type === 'nowPlaying') { if (misc.contextMenu.type === 'nowPlaying') {
const currentEntryList = getCurrentEntryList(playQueue); const currentEntryList = getCurrentEntryList(playQueue);
if (Number(indexToMoveTo) === playQueue[currentEntryList].length) {
dispatch(moveToBottom({ selectedEntries: multiSelect.selected }));
} else {
const uniqueIdOfIndexToMoveTo = playQueue[currentEntryList][indexToMoveTo].uniqueId; const uniqueIdOfIndexToMoveTo = playQueue[currentEntryList][indexToMoveTo].uniqueId;
dispatch( dispatch(
moveToIndex({ entries: multiSelect.selected, moveBeforeId: uniqueIdOfIndexToMoveTo }) moveToIndex({ entries: multiSelect.selected, moveBeforeId: uniqueIdOfIndexToMoveTo })
); );
}
} else if (Number(indexToMoveTo) === playlist.entry.length) {
dispatch(plMoveToBottom({ selectedEntries: multiSelect.selected }));
} else { } else {
const uniqueIdOfIndexToMoveTo = playlist.entry[indexToMoveTo].uniqueId; const uniqueIdOfIndexToMoveTo = playlist.entry[indexToMoveTo].uniqueId;
dispatch( dispatch(

Loading…
Cancel
Save