Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentHead: Update the title when it is different than the saved title #22501

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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