LoadMore now getMore with custom action callback; Fixing library re-load on re-render

This commit is contained in:
James Barnsley
2017-11-12 09:05:34 +13:00
parent 091de03559
commit 3de3848aa9
13 changed files with 68 additions and 42 deletions

View File

@ -309,12 +309,23 @@ const SpotifyMiddleware = (function(){
next(action)
break
case 'SPOTIFY_LIBRARY_TRACKS_LOADED':
case 'SPOTIFY_LIBRARY_TRACKS_LOADED_MORE':
if (action.data){
store.dispatch({
type: 'TRACKS_LOADED',
tracks: action.data.items
});
}
next(action);
break;
case 'SPOTIFY_TRACK_LOADED':
store.dispatch({
type: 'TRACK_LOADED',
key: action.data.uri,
track: action.data
type: 'TRACKS_LOADED',
tracks: [action.data]
});
next(action);
break