Country/Locale now settable via config (fixes #19); New get_config endpoint for Pusher
This commit is contained in:
@ -13,6 +13,12 @@ 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
|
||||
|
||||
@ -12,6 +12,9 @@ export default function reducer(spotify = {}, action){
|
||||
case 'SPOTIFY_DISCONNECTED':
|
||||
return Object.assign({}, spotify, { connected: false, connecting: false })
|
||||
|
||||
case 'SPOTIFY_SET_CONFIG':
|
||||
return Object.assign({}, spotify, action.config)
|
||||
|
||||
case 'PUSHER_SPOTIFY_TOKEN':
|
||||
if( spotify.authorized ) return spotify;
|
||||
return Object.assign({}, spotify, {
|
||||
|
||||
Reference in New Issue
Block a user