|
@ -1,5 +1,6 @@ |
|
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit'; |
|
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit'; |
|
|
import _ from 'lodash'; |
|
|
import _ from 'lodash'; |
|
|
|
|
|
import { nanoid } from 'nanoid/non-secure'; |
|
|
import arrayMove from 'array-move'; |
|
|
import arrayMove from 'array-move'; |
|
|
import { |
|
|
import { |
|
|
areConsecutive, |
|
|
areConsecutive, |
|
@ -243,7 +244,12 @@ const playQueueSlice = createSlice({ |
|
|
if (action.payload.columnDataKey !== '') { |
|
|
if (action.payload.columnDataKey !== '') { |
|
|
state.sortedEntry = _.orderBy( |
|
|
state.sortedEntry = _.orderBy( |
|
|
state.entry, |
|
|
state.entry, |
|
|
action.payload.columnDataKey, |
|
|
[ |
|
|
|
|
|
(entry: any) => |
|
|
|
|
|
typeof entry[action.payload.columnDataKey] === 'string' |
|
|
|
|
|
? entry[action.payload.columnDataKey].toLowerCase() |
|
|
|
|
|
: entry[action.payload.columnDataKey], |
|
|
|
|
|
], |
|
|
action.payload.sortType |
|
|
action.payload.sortType |
|
|
); |
|
|
); |
|
|
} else { |
|
|
} else { |
|
@ -251,7 +257,6 @@ const playQueueSlice = createSlice({ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const currentEntry = entrySelect(state); |
|
|
const currentEntry = entrySelect(state); |
|
|
|
|
|
|
|
|
const newCurrentSongIndex = getCurrentEntryIndexByUID( |
|
|
const newCurrentSongIndex = getCurrentEntryIndexByUID( |
|
|
action.payload.columnDataKey !== '' |
|
|
action.payload.columnDataKey !== '' |
|
|
? state.sortedEntry |
|
|
? state.sortedEntry |
|
|