quintodrome/ui/src/reducers/dialogReducer.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
549 B
JavaScript
Raw Normal View History

import { ADD_TO_PLAYLIST_CLOSE, ADD_TO_PLAYLIST_OPEN } from '../actions'
2020-05-23 20:03:42 -08:00
export const addToPlaylistDialogReducer = (
2020-05-23 20:03:42 -08:00
previousState = {
open: false,
},
payload
) => {
const { type } = payload
switch (type) {
case ADD_TO_PLAYLIST_OPEN:
2020-05-23 20:03:42 -08:00
return {
...previousState,
open: true,
selectedIds: payload.selectedIds,
onSuccess: payload.onSuccess,
2020-05-23 20:03:42 -08:00
}
case ADD_TO_PLAYLIST_CLOSE:
return { ...previousState, open: false, onSuccess: undefined }
2020-05-23 20:03:42 -08:00
default:
return previousState
}
}