-
-
-
-
-
-
-
-
-
{ this.props.playlist.name }
- { this.props.playlist.description ?
: null }
-
-
- -
-
-
- {helpers.uriSource( this.props.params.uri )} playlist
-
-
- { this.props.playlist.owner ? - {this.props.playlist.owner.id}
: null }
- { this.props.playlist.followers ? - {this.props.playlist.followers.total.toLocaleString()} followers
: null }
- { this.props.playlist.last_modified ? : null }
- -
- { this.props.playlist.tracks_total ? this.props.playlist.tracks_total : '0'} tracks,
- { this.props.playlist.tracks ? : '0 mins' }
-
-
-
-
- { this.renderActions() }
-
-
- { this.props.playlist.tracks ? this.removeTracks(tracks_indexes) } reorderTracks={ (indexes, index) => this.reorderTracks(indexes, index) } /> : null }
- this.loadMore() }/>
-
+
+
- )
- } else {
- return (
-
-
-
-
-
-
-
+
+
{ this.props.playlist.name }
+ { this.props.playlist.description ?
: null }
+
+
+ -
+
+
+ {helpers.uriSource( this.props.params.uri )} playlist
+
+
+ { this.props.playlist.owner ? - {this.props.playlist.owner.id}
: null }
+ { this.props.playlist.followers ? - {this.props.playlist.followers.total.toLocaleString()} followers
: null }
+ { this.props.playlist.last_modified ? : null }
+ -
+ { this.props.playlist.tracks_total ? this.props.playlist.tracks_total : '0'} tracks,
+ { this.props.playlist.tracks ? : '0 mins' }
+
+
- )
- }
+
+ { this.renderActions() }
+
+
+ { this.props.playlist.tracks ? this.removeTracks(tracks_indexes) } reorderTracks={ (indexes, index) => this.reorderTracks(indexes, index) } /> : null }
+ this.loadMore() }/>
+
+
+ )
}
}
diff --git a/src/js/views/User.js b/src/js/views/User.js
index f2ba7f2a..67f597e0 100755
--- a/src/js/views/User.js
+++ b/src/js/views/User.js
@@ -44,75 +44,71 @@ class User extends React.Component{
}
render(){
- if (this.props.user){
- var playlists = []
- if (this.props.user.playlists_uris){
- for (var i = 0; i < this.props.user.playlists_uris.length; i++){
- var uri = this.props.user.playlists_uris[i]
- if (this.props.playlists.hasOwnProperty(uri)){
- playlists.push(this.props.playlists[uri])
- }
- }
- }
-
- if (this.props.user && this.props.user.images ){
- var image = helpers.sizedImages(this.props.user.images).huge
- } else {
- var image = null
- }
-
+ var user_id = helpers.getFromUri('userid',this.props.params.uri)
+ if (helpers.isLoading(this.props.load_queue,['spotify_users/'+user_id,'spotify_users/'+user_id+'/playlists/?'])){
return (
-
-
-
-
-
-
-
-
-
{ this.props.user.display_name ? this.props.user.display_name : this.props.user.id }
-
-
- - {this.props.user.playlists_total ? this.props.user.playlists_total.toLocaleString() : 0} playlists
- - {this.props.user.followers.total.toLocaleString()} followers
- {this.isMe() ? - You
: null}
-
-
-
-
-
-
-
-
-
-
- Playlists
-
- this.loadMore() }/>
-
-
+
)
- } else {
+ }
- return (
-
-
-
-
+ if (!this.props.user) return null
+
+ var playlists = []
+ if (this.props.user.playlists_uris){
+ for (var i = 0; i < this.props.user.playlists_uris.length; i++){
+ var uri = this.props.user.playlists_uris[i]
+ if (this.props.playlists.hasOwnProperty(uri)){
+ playlists.push(this.props.playlists[uri])
+ }
+ }
+ }
+
+ if (this.props.user && this.props.user.images ){
+ var image = helpers.sizedImages(this.props.user.images).huge
+ } else {
+ var image = null
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
{ this.props.user.display_name ? this.props.user.display_name : this.props.user.id }
+
+
+ - {this.props.user.playlists_total ? this.props.user.playlists_total.toLocaleString() : 0} playlists
+ - {this.props.user.followers.total.toLocaleString()} followers
+ {this.isMe() ? - You
: null}
+
+
-
+
- );
- }
-
+
+
+
+ Playlists
+
+ this.loadMore() }/>
+
+
+
+ )
}
}
const mapStateToProps = (state, ownProps) => {
return {
+ load_queue: state.ui.load_queue,
spotify_authorized: state.spotify.authorized,
me: state.spotify.me,
playlists: state.ui.playlists,