No need for tiles, just service status

This commit is contained in:
James Barnsley
2017-11-04 14:03:59 +13:00
parent 98b21efbdf
commit a50c8b454e
8 changed files with 83 additions and 99 deletions

View File

@ -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' });
}
);
}