Merge pull request #1439 from processing/title-indexing

Fixes #1425 - Removes sketch title from <title> for unsaved, new sketch
This commit is contained in:
Cassie Tarakajian 2020-05-26 18:35:16 -04:00 committed by GitHub
commit b0ee542b71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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