Icon structure; Adding Genius icon; Fixing LastFM me loader

This commit is contained in:
James Barnsley
2018-08-22 08:13:08 +12:00
parent e8eae52cf2
commit 5e51a95a40
12 changed files with 14397 additions and 10780 deletions

View File

@ -147,7 +147,9 @@ export function authorizationGranted(data){
}
export function revokeAuthorization(){
return { type: 'LASTFM_AUTHORIZATION_REVOKED' }
return {
type: 'LASTFM_AUTHORIZATION_REVOKED'
}
}

View File

@ -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

View File

@ -121,7 +121,7 @@ const localstorageMiddleware = (function(){
helpers.setStorage(
'lastfm',
{
me: action.data.session.user
me: action.me
}
);
break;