No need for tiles, just service status
This commit is contained in:
@ -192,25 +192,8 @@ export function set(data){
|
||||
|
||||
export function connect(){
|
||||
return (dispatch, getState) => {
|
||||
|
||||
dispatch({ type: 'SPOTIFY_CONNECTING' });
|
||||
|
||||
// send a generic request to ensure spotify is up and running
|
||||
// there is no 'test' or 'ping' endpoint on the Spotify API
|
||||
sendRequest(dispatch, getState, 'browse/categories?limit=1' )
|
||||
.then(
|
||||
response => {
|
||||
dispatch({
|
||||
type: 'SPOTIFY_CONNECTED'
|
||||
});
|
||||
},
|
||||
error => {
|
||||
dispatch(coreActions.handleException(
|
||||
'Could not connect to Spotify',
|
||||
error
|
||||
));
|
||||
}
|
||||
);
|
||||
dispatch(getMe());
|
||||
}
|
||||
}
|
||||
|
||||
@ -260,12 +243,14 @@ export function getMe(){
|
||||
type: 'SPOTIFY_ME_LOADED',
|
||||
data: response
|
||||
});
|
||||
dispatch({ type: 'SPOTIFY_CONNECTED' });
|
||||
},
|
||||
error => {
|
||||
dispatch(coreActions.handleException(
|
||||
'Could not load your profile',
|
||||
error
|
||||
));
|
||||
dispatch({ type: 'SPOTIFY_DISCONNECTED' });
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -27,10 +27,7 @@ const SpotifyMiddleware = (function(){
|
||||
store.dispatch(spotifyActions.getAllLibraryPlaylists())
|
||||
}
|
||||
|
||||
// Get the current logged-in user
|
||||
store.dispatch(spotifyActions.getMe())
|
||||
|
||||
next(action)
|
||||
next(action);
|
||||
break
|
||||
|
||||
case 'SPOTIFY_AUTHORIZATION_GRANTED':
|
||||
|
||||
Reference in New Issue
Block a user