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

@ -7,6 +7,7 @@ import FontAwesome from 'react-fontawesome'
import SpotifyAuthenticationFrame from '../components/SpotifyAuthenticationFrame'
import ConfirmationButton from '../components/ConfirmationButton'
import PusherConnectionList from '../components/PusherConnectionList'
import VersionManager from '../components/VersionManager'
import Header from '../components/Header'
import * as pusherActions from '../services/pusher/actions'
@ -142,9 +143,13 @@ class Settings extends React.Component{
<SpotifyAuthenticationFrame />
<ConfirmationButton content="Reset all settings" confirmingContent="Are you sure?" onConfirm={() => this.resetAllSettings()} />
<h3 className="underline">Advanced</h3>
<label>
<div className="label">Version</div>
<div className="input">
<VersionManager />
</div>
</label>
<label>
<div className="label">Connections</div>
<div className="input">
@ -152,6 +157,8 @@ class Settings extends React.Component{
</div>
</label>
<ConfirmationButton content="Reset all settings" confirmingContent="Are you sure?" onConfirm={() => this.resetAllSettings()} />
</section>
</div>
);

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(){