aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/lib/url.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-07-06 16:14:30 +0200
committerNoah Loomans <noahloomans@gmail.com>2018-07-06 16:14:30 +0200
commitebb14ffc54670c8e2cbeba18eac238965eee4e81 (patch)
treed411ba6066a0ee4f38e85a6327456b9b4bc4b13b /src/client/react/lib/url.js
parent9f935565ebe09444b7b576b0be986c6271baef39 (diff)
client: Simplify setUser
Diffstat (limited to 'src/client/react/lib/url.js')
-rw-r--r--src/client/react/lib/url.js6
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}`);
+ }
};
}