aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components/container/Search.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-03-20 16:51:59 +0100
committerNoah Loomans <noahloomans@gmail.com>2018-03-20 16:51:59 +0100
commit6ebb626a4beb1d47750c944c771e4f5487fb9ce4 (patch)
tree36c52c98bd11942c61cf436ad522e4d7702d0f4a /src/client/react/components/container/Search.js
parente0ef8b7bca99692357a1d2f476b73124ff8406ac (diff)
Use setUser and setWeek everywhere
Diffstat (limited to 'src/client/react/components/container/Search.js')
-rw-r--r--src/client/react/components/container/Search.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/react/components/container/Search.js b/src/client/react/components/container/Search.js
index 9c67667..c968957 100644
--- a/src/client/react/components/container/Search.js
+++ b/src/client/react/components/container/Search.js
@@ -26,7 +26,7 @@ import { withRouter } from 'react-router-dom';
import SearchIcon from 'react-icons/lib/md/search';
-import { userFromMatch } from '../../lib/url';
+import { setUser, userFromMatch } from '../../lib/url';
import users from '../../users';
import Menu from './Menu';
@@ -41,6 +41,7 @@ class Search extends React.Component {
// react-router
match: PropTypes.object.isRequired,
+ location: PropTypes.object.isRequired,
history: PropTypes.object.isRequired,
// redux
@@ -115,7 +116,7 @@ class Search extends React.Component {
// Therefor, we need to dispatch the SET_USER command manually.
this.props.dispatch({ type: 'SEARCH/SET_USER', user: urlUser });
} else if (result) {
- this.props.history.push(`/${result}`);
+ setUser(result, this.props.location, this.props.history);
}
break;