Skip to content
Snippets Groups Projects
Commit 3c6e9723 authored by Ben Wheeler's avatar Ben Wheeler
Browse files

reset title on transitioning to isShowingWithoutId

parent 5afd19b1
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,10 @@ const TitledHOC = function (WrappedComponent) { ...@@ -27,6 +27,10 @@ const TitledHOC = function (WrappedComponent) {
if (this.props.projectTitle !== prevProps.projectTitle) { if (this.props.projectTitle !== prevProps.projectTitle) {
this.handleReceivedProjectTitle(this.props.projectTitle); this.handleReceivedProjectTitle(this.props.projectTitle);
} }
if (this.props.isShowingWithoutId && !prevProps.isShowingWithoutId) {
const defaultProjectTitle = this.handleReceivedProjectTitle();
this.props.onUpdateProjectTitle(defaultProjectTitle);
}
// if the projectTitle hasn't changed, but the reduxProjectTitle // if the projectTitle hasn't changed, but the reduxProjectTitle
// HAS changed, we need to report that change to the projectTitle's owner // HAS changed, we need to report that change to the projectTitle's owner
if (this.props.reduxProjectTitle !== prevProps.reduxProjectTitle && if (this.props.reduxProjectTitle !== prevProps.reduxProjectTitle &&
...@@ -40,6 +44,7 @@ const TitledHOC = function (WrappedComponent) { ...@@ -40,6 +44,7 @@ const TitledHOC = function (WrappedComponent) {
newTitle = this.props.intl.formatMessage(messages.defaultProjectTitle); newTitle = this.props.intl.formatMessage(messages.defaultProjectTitle);
} }
this.props.onChangedProjectTitle(newTitle); this.props.onChangedProjectTitle(newTitle);
return newTitle;
} }
render () { render () {
const { const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment