Window title reflects current view; Hosted-instance tracking

This commit is contained in:
James Barnsley
2018-06-29 14:26:06 +12:00
parent 29f60071a9
commit 82fa3354c6
24 changed files with 23258 additions and 21027 deletions

View File

@ -34,6 +34,8 @@ class LibraryAlbums extends React.Component{
}
componentDidMount(){
this.props.uiActions.setWindowTitle("Albums");
if (this.props.mopidy_library_albums_status != 'finished' && this.props.mopidy_library_albums_status != 'started' && this.props.mopidy_connected && (this.props.source == 'all' || this.props.source == 'local')){
this.props.mopidyActions.getLibraryAlbums()
}

View File

@ -30,6 +30,8 @@ class LibraryArtists extends React.Component{
}
componentDidMount(){
this.props.uiActions.setWindowTitle("Artists");
if (!this.props.mopidy_library_artists && this.props.mopidy_connected && (this.props.source == 'all' || this.props.source == 'local')){
this.props.mopidyActions.getLibraryArtists();
}

View File

@ -26,6 +26,7 @@ class LibraryBrowse extends React.Component{
}
componentWillReceiveProps(nextProps){
this.props.uiActions.setWindowTitle("Browse");
// mopidy goes online
if (!this.props.mopidy_connected && nextProps.mopidy_connected){

View File

@ -31,6 +31,8 @@ class LibraryPlaylists extends React.Component{
}
componentDidMount(){
this.props.uiActions.setWindowTitle("Playlists");
if (!this.props.mopidy_library_playlists && this.props.mopidy_connected && (this.props.source == 'all' || this.props.source == 'local')){
this.props.mopidyActions.getLibraryPlaylists()
}

View File

@ -10,6 +10,7 @@ import LazyLoadListener from '../../components/LazyLoadListener'
import Icon from '../../components/Icon'
import * as helpers from '../../helpers'
import * as uiActions from '../../services/ui/actions'
import * as mopidyActions from '../../services/mopidy/actions'
import * as spotifyActions from '../../services/spotify/actions'
@ -21,6 +22,8 @@ class LibraryTracks extends React.Component{
// on render
componentDidMount(){
this.props.uiActions.setWindowTitle("Tracks");
if (this.props.library_tracks === undefined){
this.props.spotifyActions.getLibraryTracks();
}
@ -103,6 +106,7 @@ const mapStateToProps = (state, ownProps) => {
const mapDispatchToProps = (dispatch) => {
return {
uiActions: bindActionCreators(uiActions, dispatch),
mopidyActions: bindActionCreators(mopidyActions, dispatch),
spotifyActions: bindActionCreators(spotifyActions, dispatch)
}