Categories in full index

This commit is contained in:
James Barnsley
2017-01-19 13:19:11 +13:00
parent 334481541d
commit fc55a112d2
6 changed files with 57 additions and 35 deletions

View File

@ -16,15 +16,19 @@ class DiscoverCategory extends React.Component{
}
componentDidMount(){
this.props.spotifyActions.getCategory( this.props.params.id );
this.loadCategory()
}
componentWillReceiveProps( nextProps ){
if( nextProps.params.id != this.props.params.id ){
this.props.spotifyActions.getCategory( nextProps.params.id );
this.loadCategory()
}
}
loadCategory(){
if (!this.props.category || !this.props.category.playlists_uris) this.props.spotifyActions.getCategory( this.props.params.id );
}
loadMore(){
if (this.props.category.playlists_more){
this.props.spotifyActions.getURL( this.props.category.playlists_more, 'SPOTIFY_CATEGORY_PLAYLISTS_LOADED', 'category:'+this.props.params.id );