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

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