Window title reflects current view; Hosted-instance tracking
This commit is contained in:
@ -31,6 +31,7 @@ class Artist extends React.Component{
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
this.setWindowTitle();
|
||||
this.loadArtist();
|
||||
}
|
||||
|
||||
@ -42,6 +43,22 @@ class Artist extends React.Component{
|
||||
this.loadArtist(nextProps);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.props.artist && nextProps.artist){
|
||||
this.setWindowTitle(nextProps.artist);
|
||||
}
|
||||
|
||||
if (this.props.params.uri !== nextProps.params.uri && nextProps.artist){
|
||||
this.setWindowTitle(nextProps.artist);
|
||||
}
|
||||
}
|
||||
|
||||
setWindowTitle(artist = this.props.artist){
|
||||
if (artist){
|
||||
this.props.uiActions.setWindowTitle(artist.name+" (artist)");
|
||||
} else{
|
||||
this.props.uiActions.setWindowTitle("Artist");
|
||||
}
|
||||
}
|
||||
|
||||
handleContextMenu(e){
|
||||
|
||||
Reference in New Issue
Block a user