Auto eslint fix
This commit is contained in:
@ -1,38 +1,34 @@
|
||||
|
||||
import * as helpers from '../../helpers';
|
||||
|
||||
export default function reducer(google = {}, action){
|
||||
switch (action.type){
|
||||
export default function reducer(google = {}, action) {
|
||||
switch (action.type) {
|
||||
case 'GOOGLE_SET':
|
||||
return { ...google, ...action.data };
|
||||
|
||||
case 'GOOGLE_SET':
|
||||
return Object.assign({}, google, action.data);
|
||||
case 'GOOGLE_LIBRARY_ARTISTS_LOADED':
|
||||
if (google.library_artists) {
|
||||
var uris = [...google.library_artists, ...action.uris];
|
||||
} else {
|
||||
var { uris } = action;
|
||||
}
|
||||
return { ...google, library_artists: helpers.removeDuplicates(uris) };
|
||||
|
||||
case 'GOOGLE_LIBRARY_ARTISTS_LOADED':
|
||||
if (google.library_artists){
|
||||
var uris = [...google.library_artists,...action.uris];
|
||||
} else {
|
||||
var uris = action.uris;
|
||||
}
|
||||
return Object.assign({}, google, { library_artists: helpers.removeDuplicates(uris) });
|
||||
case 'GOOGLE_CLEAR_LIBRARY_ARTISTS':
|
||||
return { ...google, library_artists: null };
|
||||
|
||||
case 'GOOGLE_CLEAR_LIBRARY_ARTISTS':
|
||||
return Object.assign({}, google, { library_artists: null });
|
||||
case 'GOOGLE_LIBRARY_ALBUMS_LOADED':
|
||||
if (google.library_albums) {
|
||||
var uris = [...google.library_albums, ...action.uris];
|
||||
} else {
|
||||
var { uris } = action;
|
||||
}
|
||||
return { ...google, library_albums: helpers.removeDuplicates(uris) };
|
||||
|
||||
case 'GOOGLE_LIBRARY_ALBUMS_LOADED':
|
||||
if (google.library_albums){
|
||||
var uris = [...google.library_albums,...action.uris];
|
||||
} else {
|
||||
var uris = action.uris;
|
||||
}
|
||||
return Object.assign({}, google, { library_albums: helpers.removeDuplicates(uris) });
|
||||
case 'GOOGLE_CLEAR_LIBRARY_ALBUMS':
|
||||
return { ...google, library_albums: null };
|
||||
|
||||
case 'GOOGLE_CLEAR_LIBRARY_ALBUMS':
|
||||
return Object.assign({}, google, { library_albums: null });
|
||||
|
||||
default:
|
||||
return google
|
||||
}
|
||||
default:
|
||||
return google;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user