From 7bfb87a0beda7247f1edc687b34144859813758a Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Fri, 6 Jul 2018 17:34:06 +0200 Subject: client: Remove url helpers --- src/client/react/store/selectors.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/client/react/store') diff --git a/src/client/react/store/selectors.js b/src/client/react/store/selectors.js index 8264cdb..2567107 100644 --- a/src/client/react/store/selectors.js +++ b/src/client/react/store/selectors.js @@ -1,5 +1,6 @@ import moment from 'moment'; import queryString from 'query-string'; +import isNaN from 'lodash/isNaN'; import purifyWeek from '../lib/purifyWeek'; import users from '../users'; @@ -21,8 +22,9 @@ export function selectCurrentWeek(store) { export function selectWeek(store) { const { location } = store.router; const weekStr = queryString.parse(location.search).week; + const week = parseInt(weekStr, 10); - if (!weekStr) { + if (isNaN(week)) { return selectCurrentWeek(store); } -- cgit v1.1