Search maturity; Service status

This commit is contained in:
James Barnsley
2016-11-06 15:47:37 +13:00
parent 5b2604583f
commit b55bec8494
23 changed files with 7323 additions and 6816 deletions

View File

@ -58,7 +58,10 @@ function getToken( dispatch, getState ){
refreshToken( dispatch, getState )
.then(
response => resolve(response.access_token),
error => reject(error)
error => {
dispatch({ type: 'SPOTIFY_DISCONNECTED' })
reject(error)
}
);
});
}
@ -131,14 +134,16 @@ export function setConfig( config ){
}
export function connect(){
return {
type: 'SPOTIFY_CONNECTING'
}
}
return (dispatch, getState) => {
export function disconnect(){
return {
type: 'SPOTIFY_DISCONNECT'
dispatch({ type: 'SPOTIFY_CONNECTING' });
sendRequest( dispatch, getState, 'browse/categories?limit=1' )
.then( response => {
dispatch({
type: 'SPOTIFY_CONNECTED'
});
});
}
}