Window title reflects current view; Hosted-instance tracking
This commit is contained in:
@ -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()
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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){
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user