Handling non-authorized Genius

This commit is contained in:
James Barnsley
2018-08-21 21:08:11 +12:00
parent e97bc4f401
commit b02e4ef1ce
9 changed files with 13906 additions and 10583 deletions

View File

@ -66,7 +66,7 @@ class Track extends React.Component{
}
// Ready to load lyrics
if (!nextProps.track.lyrics_results){
if (nextProps.genius_authorized && !nextProps.track.lyrics_results){
this.props.geniusActions.findTrackLyrics(nextProps.track);
}
}
@ -274,8 +274,9 @@ class Track extends React.Component{
<ContextMenuTrigger onTrigger={e => this.handleContextMenu(e)} />
</div>
{this.renderLyricsSelector()}
{this.renderLyrics()}
{!this.props.genius_authorized ? <p className="no-results">Want track lyrics? Authorize Genius under <Link to={global.baseURL+"settings/service/genius"}>Settings</Link>.</p> : null}
{this.props.genius_authorized ? this.renderLyricsSelector() : null}
{this.props.genius_authorized ? this.renderLyrics() : null}
</div>
)
@ -302,6 +303,7 @@ const mapStateToProps = (state, ownProps) => {
local_library_albums: state.mopidy.library_albums,
lastfm_authorized: state.lastfm.session,
spotify_authorized: state.spotify.authorization,
genius_authorized: state.genius.authorization,
mopidy_connected: state.mopidy.connected
};
}