From fd8df387c8df6231d230b5f3fc7f32a0ff49558e Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Thu, 3 Sep 2020 08:42:08 -0700 Subject: [PATCH] Refresh should reset date range. --- components/common/RefreshButton.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/common/RefreshButton.js b/components/common/RefreshButton.js index 2d948cde..60d0976e 100644 --- a/components/common/RefreshButton.js +++ b/components/common/RefreshButton.js @@ -5,6 +5,7 @@ import Button from './Button'; import Refresh from 'assets/redo.svg'; import Dots from 'assets/ellipsis-h.svg'; import { useDateRange } from 'hooks/useDateRange'; +import { getDateRange } from '../../lib/date'; export default function RefreshButton({ websiteId }) { const dispatch = useDispatch(); @@ -15,7 +16,7 @@ export default function RefreshButton({ websiteId }) { function handleClick() { if (dateRange) { setLoading(true); - dispatch(setDateRange(websiteId, dateRange)); + dispatch(setDateRange(websiteId, getDateRange(dateRange.value))); } }