Config includes spotify-user for rendering in Settings

This commit is contained in:
James Barnsley
2017-02-06 13:00:21 +13:00
parent 94c947e90e
commit 93eabe59c2
8 changed files with 35 additions and 26 deletions

View File

@ -13,20 +13,10 @@ const SpotifyMiddleware = (function(){
switch(action.type){
case 'CONFIG':
if (!state.spotify.country || !state.spotify.locale){
store.dispatch( spotifyActions.setConfig(action.data.config) )
}
break
case 'SPOTIFY_CONNECT':
store.dispatch( spotifyActions.getMe() )
break
case 'SPOTIFY_DISCONNECTED':
store.dispatch( uiActions.createNotification('Spotify disconnected','bad') )
break
case 'SPOTIFY_CREATE_PLAYLIST':
if( !store.getState().spotify.authorized ){
store.dispatch( uiActions.createNotification( "Must be logged in to Spotify to do that", 'bad' ) )
@ -103,8 +93,8 @@ const SpotifyMiddleware = (function(){
next(action)
// only resolve if radio is enabled
if( action.data.radio.enabled ){
store.dispatch(spotifyActions.resolveRadioSeeds(action.data.radio))
if( action.radio.enabled ){
store.dispatch(spotifyActions.resolveRadioSeeds(action.radio))
}
break