From ebb14ffc54670c8e2cbeba18eac238965eee4e81 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Fri, 6 Jul 2018 16:14:30 +0200 Subject: client: Simplify setUser --- src/client/react/lib/url.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/client/react/lib') 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}`); + } }; } -- cgit v1.1