Skip to content

Commit 3c6e972

Browse files
committed
reset title on transitioning to isShowingWithoutId
1 parent 5afd19b commit 3c6e972

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/titled-hoc.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ const TitledHOC = function (WrappedComponent) {
2727
if (this.props.projectTitle !== prevProps.projectTitle) {
2828
this.handleReceivedProjectTitle(this.props.projectTitle);
2929
}
30+
if (this.props.isShowingWithoutId && !prevProps.isShowingWithoutId) {
31+
const defaultProjectTitle = this.handleReceivedProjectTitle();
32+
this.props.onUpdateProjectTitle(defaultProjectTitle);
33+
}
3034
// if the projectTitle hasn't changed, but the reduxProjectTitle
3135
// HAS changed, we need to report that change to the projectTitle's owner
3236
if (this.props.reduxProjectTitle !== prevProps.reduxProjectTitle &&
@@ -40,6 +44,7 @@ const TitledHOC = function (WrappedComponent) {
4044
newTitle = this.props.intl.formatMessage(messages.defaultProjectTitle);
4145
}
4246
this.props.onChangedProjectTitle(newTitle);
47+
return newTitle;
4348
}
4449
render () {
4550
const {

0 commit comments

Comments
 (0)