Icon structure; Adding Genius icon; Fixing LastFM me loader
This commit is contained in:
@ -147,7 +147,9 @@ export function authorizationGranted(data){
|
||||
}
|
||||
|
||||
export function revokeAuthorization(){
|
||||
return { type: 'LASTFM_AUTHORIZATION_REVOKED' }
|
||||
return {
|
||||
type: 'LASTFM_AUTHORIZATION_REVOKED'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,51 +1,27 @@
|
||||
|
||||
var helpers = require('./../../helpers')
|
||||
var lastfmActions = require('./actions')
|
||||
var uiActions = require('../ui/actions')
|
||||
var pusherActions = require('../pusher/actions')
|
||||
var helpers = require('./../../helpers');
|
||||
var coreActions = require('../core/actions');
|
||||
|
||||
const LastfmMiddleware = (function(){
|
||||
|
||||
/**
|
||||
* The actual middleware inteceptor
|
||||
**/
|
||||
return store => next => action => {
|
||||
var state = store.getState();
|
||||
|
||||
switch(action.type){
|
||||
|
||||
case 'LASTFM_SET':
|
||||
console.log(action);
|
||||
next(action);
|
||||
break;
|
||||
|
||||
case 'LASTFM_ME_LOADED':
|
||||
store.dispatch({
|
||||
type: 'LASTFM_USER_LOADED',
|
||||
user: action.me
|
||||
});
|
||||
next(action);
|
||||
break;
|
||||
|
||||
case 'LASTFM_USER_LOADED':
|
||||
var user = Object.assign(
|
||||
{},
|
||||
action.user,
|
||||
action.me,
|
||||
{
|
||||
uri: "lastfm:user:"+action.user.name
|
||||
uri: "lastfm:user:"+action.me.name
|
||||
}
|
||||
);
|
||||
store.dispatch(coreActions.userLoaded(user));
|
||||
next(action);
|
||||
break;
|
||||
|
||||
|
||||
// This action is irrelevant to us, pass it on to the next middleware
|
||||
default:
|
||||
return next(action);
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
export default LastfmMiddleware
|
||||
@ -121,7 +121,7 @@ const localstorageMiddleware = (function(){
|
||||
helpers.setStorage(
|
||||
'lastfm',
|
||||
{
|
||||
me: action.data.session.user
|
||||
me: action.me
|
||||
}
|
||||
);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user