Fixes #1425 - Removes sketch title from <title> for unsaved, new sketch

This commit is contained in:
Cassie Tarakajian 2020-05-26 18:05:35 -04:00
parent 85163bd937
commit b929e77952

View file

@ -123,6 +123,11 @@ class IDEView extends React.Component {
this.autosaveInterval = null; this.autosaveInterval = null;
} }
getTitle = () => {
const { id } = this.props.project;
return id ? `p5.js Web Editor | ${this.props.project.name}` : 'p5.js Web Editor';
}
isUserOwner() { isUserOwner() {
return this.props.project.owner && this.props.project.owner.id === this.props.user.id; return this.props.project.owner && this.props.project.owner.id === this.props.user.id;
} }
@ -203,7 +208,7 @@ class IDEView extends React.Component {
return ( return (
<div className="ide"> <div className="ide">
<Helmet> <Helmet>
<title>p5.js Web Editor | {this.props.project.name}</title> <title>{this.getTitle()}</title>
</Helmet> </Helmet>
{this.props.toast.isVisible && <Toast />} {this.props.toast.isVisible && <Toast />}
<Nav <Nav