Skip to content

Commit

Permalink
Components: Cancel debounced title set on unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored and vindl committed Oct 18, 2017
1 parent 34e9f68 commit b27c234
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/components/data/document-head/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ class DocumentHead extends Component {
}
}

componentWillUnmount() {
this.setFormattedTitle.cancel();
}

setFormattedTitle = debounce( ( title ) => {
document.title = title;
} )
Expand Down

0 comments on commit b27c234

Please sign in to comment.