Auto eslint fix

This commit is contained in:
James Barnsley
2019-09-05 15:36:11 +12:00
parent 4513a0d109
commit e4d53a2d35
126 changed files with 23283 additions and 23573 deletions

View File

@ -1,39 +1,37 @@
var helpers = require('./../../helpers');
var coreActions = require('../core/actions');
var lastfmActions = require('./actions');
const helpers = require('./../../helpers');
const coreActions = require('../core/actions');
const lastfmActions = require('./actions');
const LastfmMiddleware = (function(){
const LastfmMiddleware = (function () {
return (store) => (next) => (action) => {
switch (action.type) {
case 'LASTFM_ME_LOADED':
var me = helpers.formatUser(action.me);
Object.assign(
me,
{
uri: `lastfm:user:${me.name}`,
},
);
store.dispatch(coreActions.userLoaded(me));
action.me = me;
next(action);
break;
return store => next => action => {
switch(action.type){
case 'LASTFM_IMPORT_AUTHORIZATION':
case 'LASTFM_ME_LOADED':
var me = helpers.formatUser(action.me);
Object.assign(
me,
{
uri: "lastfm:user:"+me.name
}
);
store.dispatch(coreActions.userLoaded(me));
action.me = me;
next(action);
break;
// Wait a few moments before we fetch, allowing the import to complete first
// TODO: Use callbacks for better code accuracy
setTimeout(() => { store.dispatch(lastfmActions.getMe()); }, 100);
case 'LASTFM_IMPORT_AUTHORIZATION':
next(action);
break;
// Wait a few moments before we fetch, allowing the import to complete first
// TODO: Use callbacks for better code accuracy
setTimeout(() => {store.dispatch(lastfmActions.getMe())}, 100);
next(action);
break;
default:
return next(action);
}
default:
return next(action);
}
})();
};
}());
export default LastfmMiddleware
export default LastfmMiddleware;