File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ const messages = defineMessages({
21
21
const TitledHOC = function ( WrappedComponent ) {
22
22
class TitledComponent extends React . Component {
23
23
componentDidMount ( ) {
24
- this . props . updateReduxProjectTitle ( this . titleWithDefault ( this . props . projectTitle ) ) ;
24
+ this . updateReduxProjectTitleWithDefault ( this . props . projectTitle ) ;
25
25
}
26
26
componentDidUpdate ( prevProps ) {
27
27
if ( this . props . projectTitle !== prevProps . projectTitle ) {
28
- this . props . updateReduxProjectTitle ( this . titleWithDefault ( this . props . projectTitle ) ) ;
28
+ this . updateReduxProjectTitleWithDefault ( this . props . projectTitle ) ;
29
29
}
30
30
// if the projectTitle hasn't changed, but the reduxProjectTitle
31
31
// HAS changed, we need to report that change to the projectTitle's owner
@@ -34,11 +34,12 @@ const TitledHOC = function (WrappedComponent) {
34
34
this . props . onUpdateProjectTitle ( this . props . reduxProjectTitle ) ;
35
35
}
36
36
}
37
- titleWithDefault ( title ) {
38
- if ( title === null || typeof title === 'undefined' ) {
39
- return this . props . intl . formatMessage ( messages . defaultProjectTitle ) ;
37
+ updateReduxProjectTitleWithDefault ( requestedTitle ) {
38
+ let newTitle = requestedTitle ;
39
+ if ( newTitle === null || typeof newTitle === 'undefined' ) {
40
+ newTitle = this . props . intl . formatMessage ( messages . defaultProjectTitle ) ;
40
41
}
41
- return title ;
42
+ this . props . updateReduxProjectTitle ( newTitle ) ;
42
43
}
43
44
render ( ) {
44
45
const {
You can’t perform that action at this time.
0 commit comments