Version manager for pusher; Local spotify tokens

This commit is contained in:
James Barnsley
2016-10-29 22:40:02 +13:00
parent f4ca6b7fde
commit 5df6580f61
13 changed files with 181 additions and 42 deletions

View File

@ -18,16 +18,21 @@ class LibraryPlaylists extends React.Component{
// on render
componentDidMount(){
if( this.props.mopidy.connected ) this.loadPlaylists();
if( this.props.mopidy.connected ){
this.props.mopidyActions.getPlaylists();
}
if( this.props.spotify.authorized ){
this.props.spotifyActions.getLibraryPlaylists();
}
}
componentWillReceiveProps( nextProps ){
if( !this.props.mopidy.connected && nextProps.mopidy.connected ) this.loadPlaylists();
}
loadPlaylists(){
this.props.spotifyActions.getLibraryPlaylists();
this.props.mopidyActions.getPlaylists();
if( !this.props.mopidy.connected && nextProps.mopidy.connected ){
this.props.mopidyActions.getPlaylists();
}
if( !this.props.spotify.authorized && nextProps.spotify.authorized ){
this.props.spotifyActions.getLibraryPlaylists();
}
}
compiledPlaylistSources(){