diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-07-06 16:14:30 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-07-06 16:14:30 +0200 |
commit | ebb14ffc54670c8e2cbeba18eac238965eee4e81 (patch) | |
tree | d411ba6066a0ee4f38e85a6327456b9b4bc4b13b /src/client/react/lib | |
parent | 9f935565ebe09444b7b576b0be986c6271baef39 (diff) |
client: Simplify setUser
Diffstat (limited to 'src/client/react/lib')
-rw-r--r-- | src/client/react/lib/url.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/react/lib/url.js b/src/client/react/lib/url.js index 752fec2..442e5eb 100644 --- a/src/client/react/lib/url.js +++ b/src/client/react/lib/url.js @@ -74,7 +74,11 @@ export function makeSetWeek(history) { export function makeUpdatePathname(history) { return function updatePathname(pathname) { const query = history.location.search; - history.push(`/${pathname}${query}`); + if (pathname) { + history.push(`/${pathname}${query}`); + } else { + history.push(`/${query}`); + } }; } |