Skip to content

Commit

Permalink
Merge pull request #268 from caktus/fix-dropdown-year-bug
Browse files Browse the repository at this point in the history
Fix dropdown bug not reversing years to quickly select the recent years under the 'All' option.
  • Loading branch information
Afani97 authored Feb 14, 2024
2 parents 82d77f4 + 7f9efaa commit 20bf16a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/Components/Charts/Overview/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ import useOfficerId from '../../../Hooks/useOfficerId';
import DataSubsetPicker from '../ChartSections/DataSubsetPicker/DataSubsetPicker';
import PieChart from '../../NewCharts/PieChart';
import { pieChartConfig, pieChartLabels } from '../../../util/setChartColors';
import useYearSet from '../../../Hooks/useYearSet';

function Overview(props) {
const { agencyId } = props;
const history = useHistory();
const match = useRouteMatch();
const officerId = useOfficerId();
const [yearRange] = useYearSet();

useDataset(agencyId, STOPS);
useDataset(agencyId, SEARCHES);
Expand Down Expand Up @@ -203,7 +205,7 @@ function Overview(props) {
label="Year"
value={year}
onChange={handleYearSelect}
options={[YEARS_DEFAULT].concat(chartState.yearRange)}
options={[YEARS_DEFAULT].concat(yearRange)}
dropDown
/>
</div>
Expand Down

0 comments on commit 20bf16a

Please sign in to comment.