diff options
Diffstat (limited to 'src/client/react/store/actions.js')
-rw-r--r-- | src/client/react/store/actions.js | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/client/react/store/actions.js b/src/client/react/store/actions.js index 36dc748..2d2cd30 100644 --- a/src/client/react/store/actions.js +++ b/src/client/react/store/actions.js @@ -4,18 +4,10 @@ import withinRange from '../lib/withinRange'; export function setUser(newUser) { return (dispatch, getState, { getHistory }) => { - const { user, updatePathname } = getHistory(); + const { updatePathname } = getHistory(); - if (newUser === user) { - // EDGE CASE: If the user that is being selected is equal to the user - // that is already selected, then updatePathname will not change - // anything. This results in state.search not properly being resetted. - // Example: If you search for 5H2 while already viewing 6-5H2, pressing - // enter won't do anything unless this check is present. - dispatch({ type: 'SEARCH/SET_USER', user }); - } else { - updatePathname(newUser || ''); - } + dispatch({ type: 'SEARCH/RESET' }); + updatePathname(newUser); }; } |