From 1c810061820482593d9b3e975841bc8f412f099a Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Tue, 10 Apr 2018 20:47:37 +1200 Subject: [PATCH] Loader for artist when completely empty --- src/js/views/Artist.js | 91 ++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 52 deletions(-) diff --git a/src/js/views/Artist.js b/src/js/views/Artist.js index f4e151ec..490ea399 100755 --- a/src/js/views/Artist.js +++ b/src/js/views/Artist.js @@ -237,68 +237,55 @@ class Artist extends React.Component{ } render(){ + var scheme = helpers.uriSource(this.props.params.uri); - var scheme = helpers.uriSource(this.props.params.uri ) + if (!this.props.artist){ + if (helpers.isLoading(this.props.load_queue,['spotify_artists/'+helpers.getFromUri('artistid',this.props.params.uri), 'lastfm_method=artist.getInfo'])){ + return ( +
+
+
+ ) + } else { + return null; + } + } if (this.props.artist && this.props.artist.images){ - var image = helpers.sizedImages(this.props.artist.images ).huge + var image = helpers.sizedImages(this.props.artist.images).huge; } else { - var image = null + var image = null; } - if (this.props.artist){ - var is_spotify = (scheme == 'spotify') - - if (this.props.artist.tracks_uris && this.props.artist.tracks_uris.length > 0){ - var uris_to_play = this.props.artist.tracks_uris - } else { - var uris_to_play = this.props.artist.albums_uris - } - - return ( -
-
- - - -
-

{this.props.artist ? this.props.artist.name : null}

-
- - {is_spotify ? : null} - this.handleContextMenu(e)} /> -
- { this.renderSubViewMenu() } -
-
-
- {this.renderBody()} -
-
- ); - + var is_spotify = (scheme == 'spotify') + + if (this.props.artist.tracks_uris && this.props.artist.tracks_uris.length > 0){ + var uris_to_play = this.props.artist.tracks_uris } else { - return ( -
-
- -
-

- -

-
- - -
- { this.renderSubViewMenu() } + var uris_to_play = this.props.artist.albums_uris + } + + return ( +
+
+ + + +
+

{this.props.artist ? this.props.artist.name : null}

+
+ + {is_spotify ? : null} + this.handleContextMenu(e)} />
-
-
- {this.renderBody()} + { this.renderSubViewMenu() }
- ); - } +
+ {this.renderBody()} +
+
+ ); } }