From 71ea5e85aca6afb1bb3b65679d88fa502656b866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Thu, 28 Sep 2023 14:07:41 +0200 Subject: [PATCH] chore: code cleaning --- src/components/periods/PeriodSelect.js | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/components/periods/PeriodSelect.js b/src/components/periods/PeriodSelect.js index c6783af11..048efda00 100644 --- a/src/components/periods/PeriodSelect.js +++ b/src/components/periods/PeriodSelect.js @@ -27,9 +27,7 @@ const PeriodSelect = ({ periodType, }) => { const [year, setYear] = useState(getYear(period?.startDate || lastDate)) - // const [periods, setPeriods] = useState() const prevYear = usePrevious(year) - // const prevPeriods = usePrevious(periods) // Set periods when periodType or year changes /* eslint-disable react-hooks/exhaustive-deps */ @@ -69,29 +67,6 @@ const PeriodSelect = ({ [year, firstDate, lastDate] ) - // Set periods when periodType or year changes - /* - useEffect(() => { - if (periodType) { - setPeriods( - getFixedPeriodsByType({ - periodType, - year, - firstDate, - lastDate, - }) - ) - } - }, [periodType, year, firstDate, lastDate]) - - // Set saved map period - useEffect(() => { - if (!periodType && period) { - setPeriods([period]) - } - }, [periodType, period]) - */ - // Autoselect most recent period useEffect(() => { if (!period && periods) {