From 6ebb626a4beb1d47750c944c771e4f5487fb9ce4 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Tue, 20 Mar 2018 16:51:59 +0100 Subject: Use setUser and setWeek everywhere --- src/client/react/components/container/Search.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/client/react/components/container/Search.js') 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; -- cgit v1.1