From 9e55c4b1a151b434cba4b4425514c3aeac6f22d8 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Wed, 27 Jun 2018 16:45:50 +0200 Subject: Only use history in makeSetUser and makeSetWeek --- src/client/react/lib/url.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/client/react/lib') diff --git a/src/client/react/lib/url.js b/src/client/react/lib/url.js index c94383c..644fd74 100644 --- a/src/client/react/lib/url.js +++ b/src/client/react/lib/url.js @@ -43,20 +43,20 @@ export function weekFromLocation(location) { return purifyWeek(parseInt(weekStr, 10)); } -export function makeSetUser(location, history) { +export function makeSetUser(history) { return (userId) => { - const query = location.search; + const query = history.location.search; history.push(`/${userId}${query}`); }; } -export function makeSetWeek(location, history) { +export function makeSetWeek(history) { return (week) => { const query = queryString.stringify({ - ...queryString.parse(location.search), + ...queryString.parse(history.location.search), week, }); - history.push(`${location.pathname}?${query}`); + history.push(`${history.location.pathname}?${query}`); }; } -- cgit v1.1