Removing defunct Spotify backend_username in favor of api/me response, fixes #211

This commit is contained in:
James Barnsley
2017-09-27 15:29:17 +13:00
parent 2fac8dee11
commit 521186086c
5 changed files with 6 additions and 48 deletions

View File

@ -122,9 +122,7 @@ const PusherMiddleware = (function(){
response.type = 'PUSHER_CONFIG'
store.dispatch(response)
if (response.config.spotify_username && store.getState().spotify.enabled){
store.dispatch(spotifyActions.getUser('spotify:user:'+response.config.spotify_username))
}
var core = store.getState().core
if (!core.country || !core.locale){
store.dispatch(coreActions.set({
@ -348,15 +346,9 @@ const PusherMiddleware = (function(){
store.dispatch(spotifyActions.set({
locale: (action.config.locale ? action.config.locale : null),
country: (action.config.country ? action.config.country : null),
authorization_url: (action.config.authorization_url ? action.config.authorization_url : null),
backend_username: (action.config.spotify_username ? action.config.spotify_username : null)
authorization_url: (action.config.authorization_url ? action.config.authorization_url : null)
}))
// Get our backend_username user
if (store.getState().spotify.access !== 'none' && (!store.getState().core.users || !store.getState().core.users[action.config.spotify_username])){
store.dispatch(spotifyActions.getUser(action.config.spotify_username))
}
next( action )
break

View File

@ -1027,8 +1027,6 @@ export function getUserPlaylists(user_uri){
var can_edit = false
if (getState().spotify.me && response.items[i].owner.id == getState().spotify.me.id){
can_edit = true
} else if (response.items[i].owner.id == getState().backend_username){
can_edit = true
}
playlists.push(Object.assign(