Skip to content
Snippets Groups Projects
Commit 3a7eed99 authored by Ben Wheeler's avatar Ben Wheeler
Browse files

hash-parser-hoc: changed componentWillReceiveProps to componentDidUpdate

parent e82180e0
No related branches found
No related tags found
No related merge requests found
...@@ -28,9 +28,9 @@ const HashParserHOC = function (WrappedComponent) { ...@@ -28,9 +28,9 @@ const HashParserHOC = function (WrappedComponent) {
window.addEventListener('hashchange', this.handleHashChange); window.addEventListener('hashchange', this.handleHashChange);
this.handleHashChange(); this.handleHashChange();
} }
componentWillReceiveProps (nextProps) { componentDidUpdate (prevProps) {
// if we are newly fetching a non-hash project... // if we are newly fetching a non-hash project...
if (nextProps.isFetchingProjectWithNoURLId && !this.props.isFetchingProjectWithNoURLId) { if (this.props.isFetchingProjectWithNoURLId && !prevProps.isFetchingProjectWithNoURLId) {
// ...clear the hash from the url // ...clear the hash from the url
history.pushState('new-project', 'new-project', history.pushState('new-project', 'new-project',
window.location.pathname + window.location.search); window.location.pathname + window.location.search);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment