Service tiles; Start handling disabled services

This commit is contained in:
James Barnsley
2017-08-03 21:26:33 +12:00
parent 6d32e83cac
commit 123fe51289
15 changed files with 194 additions and 196 deletions

View File

@ -171,11 +171,6 @@ function refreshToken( dispatch, getState ){
})
}
/**
* Actions and Action Creators
**/
export function setConfig( config ){
return {
type: 'SPOTIFY_SET_CONFIG',

View File

@ -16,10 +16,21 @@ const SpotifyMiddleware = (function(){
switch(action.type){
case 'SPOTIFY_CONNECT':
store.dispatch( spotifyActions.getMe() )
break
case 'SPOTIFY_CONNECTED':
var label = null
if (store.getState().spotify.me) label = store.getState().spotify.me.id
ReactGA.event({ category: 'Spotify', action: 'Connected', label: label })
// TODO: remove this so we don't tap out our API limits before we even get started
// Perhaps fire this on demand? Context menu, playlists loading or AddToPlaylistModal
if (store.getState().spotify_authorized){
store.dispatch(spotifyActions.getAllLibraryPlaylists())
}
next(action)
break
@ -56,10 +67,6 @@ const SpotifyMiddleware = (function(){
next(action)
break
case 'SPOTIFY_CONNECT':
store.dispatch( spotifyActions.getMe() )
break
case 'SPOTIFY_CREATE_PLAYLIST':
if( !store.getState().spotify.authorized ){
store.dispatch( uiActions.createNotification( "Must be logged in to Spotify to do that", 'bad' ) )