Tracks library, all part of fixing #324

This commit is contained in:
James Barnsley
2018-09-15 11:58:26 +12:00
parent f66b33c3e4
commit cbdd2c4ad3
12 changed files with 10647 additions and 13866 deletions

View File

@ -24,11 +24,9 @@ class LibraryTracks extends React.Component{
componentDidMount(){
this.props.uiActions.setWindowTitle("Tracks");
if (!this.props.spotify_enabled){
if (!this.props.spotify_me){
this.props.uiActions.createNotification({type: 'warning', content: 'Enable Spotify to browse tracks'});
}
if (this.props.spotify_enabled && this.props.library_tracks === undefined){
} else if (this.props.library_tracks === undefined){
this.props.spotifyActions.getLibraryTracks();
}
}
@ -107,7 +105,7 @@ const mapStateToProps = (state, ownProps) => {
return {
load_queue: state.ui.load_queue,
tracks: state.core.tracks,
spotify_enabled: (state.mopidy.uri_schemes && state.mopidy.uri_schemes.includes('spotify:')),
spotify_me: state.spotify.me,
library_tracks: state.spotify.library_tracks,
library_tracks_more: state.spotify.library_tracks_more
}