Skip to content

Commit

Permalink
Update the document title when it is different than the saved documen…
Browse files Browse the repository at this point in the history
…t title
  • Loading branch information
ryelle committed Mar 14, 2018
1 parent 1030276 commit 4773074
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/components/data/document-head/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
getDocumentHeadFormattedTitle,
getDocumentHeadLink,
getDocumentHeadMeta,
getDocumentHeadTitle,
} from 'state/document-head/selectors';
import {
setDocumentHeadTitle as setTitle,
Expand Down Expand Up @@ -53,7 +54,7 @@ class DocumentHead extends Component {
}

componentWillReceiveProps( nextProps ) {
if ( nextProps.title !== undefined && this.props.title !== nextProps.title ) {
if ( nextProps.title !== undefined && nextProps.title !== nextProps.savedTitle ) {
this.props.setTitle( nextProps.title );
}

Expand Down Expand Up @@ -133,6 +134,7 @@ export default connect(
formattedTitle: getDocumentHeadFormattedTitle( state ),
allLinks: getDocumentHeadLink( state ),
allMeta: getDocumentHeadMeta( state ),
savedTitle: getDocumentHeadTitle( state ),
} ),
{
setTitle,
Expand Down

0 comments on commit 4773074

Please sign in to comment.