Add duplicate song warning. Fix #554
* duplicate_song_warning added * dialog_for_multiple_songs * skip button updated * duplicate_song_skip import removed * duplicate_song msg updated * handleSkip and checkDuplicateSong func modified * Update AddToPlaylistDialog.js * prettier applied * go.sum file added * duplicated songs bug fixed
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
import { ADD_TO_PLAYLIST_CLOSE, ADD_TO_PLAYLIST_OPEN } from '../actions'
|
||||
import {
|
||||
ADD_TO_PLAYLIST_CLOSE,
|
||||
ADD_TO_PLAYLIST_OPEN,
|
||||
DUPLICATE_SONG_WARNING_OPEN,
|
||||
DUPLICATE_SONG_WARNING_CLOSE,
|
||||
} from '../actions'
|
||||
|
||||
export const addToPlaylistDialogReducer = (
|
||||
previousState = {
|
||||
open: false,
|
||||
duplicateSong: false,
|
||||
},
|
||||
payload
|
||||
) => {
|
||||
@@ -17,6 +23,14 @@ export const addToPlaylistDialogReducer = (
|
||||
}
|
||||
case ADD_TO_PLAYLIST_CLOSE:
|
||||
return { ...previousState, open: false, onSuccess: undefined }
|
||||
case DUPLICATE_SONG_WARNING_OPEN:
|
||||
return {
|
||||
...previousState,
|
||||
duplicateSong: true,
|
||||
duplicateIds: payload.duplicateIds,
|
||||
}
|
||||
case DUPLICATE_SONG_WARNING_CLOSE:
|
||||
return { ...previousState, duplicateSong: false }
|
||||
default:
|
||||
return previousState
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user