User not loaded; diagnosing endpoint undefined
This commit is contained in:
@ -23,7 +23,7 @@ const sendRequest = ( dispatch, getState, endpoint, method = 'GET', data = false
|
||||
|
||||
// prepend the API baseurl, unless the endpoint already has it (ie pagination requests)
|
||||
var url = 'https://api.spotify.com/v1/'+endpoint
|
||||
if( endpoint.startsWith('https://api.spotify.com/') ) url = endpoint;
|
||||
if (endpoint.startsWith('https://api.spotify.com/')) url = endpoint;
|
||||
|
||||
// create our ajax request config
|
||||
var config = {
|
||||
|
||||
@ -87,7 +87,7 @@ class User extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
if (this.props.user && this.props.user.images ){
|
||||
if (this.props.user && this.props.user.images){
|
||||
var image = helpers.sizedImages(this.props.user.images).huge
|
||||
} else {
|
||||
var image = null
|
||||
@ -104,8 +104,8 @@ class User extends React.Component{
|
||||
<h1>{ this.props.user.display_name ? this.props.user.display_name : this.props.user.id }</h1>
|
||||
<h2>
|
||||
<ul className="details">
|
||||
<li>{this.props.user.playlists_total ? this.props.user.playlists_total.toLocaleString() : 0} playlists</li>
|
||||
<li>{this.props.user.followers.total.toLocaleString()} followers</li>
|
||||
{this.props.user.playlists_total ? <li>{this.props.user.playlists_total ? this.props.user.playlists_total.toLocaleString() : 0} playlists</li> : null}
|
||||
{this.props.user.followers ? <li>{this.props.user.followers.total.toLocaleString()} followers</li> : null}
|
||||
{this.isMe() ? <li>You</li> : null}
|
||||
</ul>
|
||||
</h2>
|
||||
|
||||
Reference in New Issue
Block a user