Skip to content

Commit

Permalink
Most actual month opening on load - resolving #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiktor Przybylski committed Mar 9, 2024
1 parent 2c24fc0 commit 6a12d5a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ export function Summary({
},
[]);

const [currentYear, setCurrentYear] = useState(availableYears[1]);
const [currentMonth, setCurrentMonth] = useState(years[currentYear][1]);
const [currentYear, setCurrentYear] = useState(availableYears[0]);

const monthsInCurrentYear = years[currentYear]
const [currentMonth, setCurrentMonth] = useState(monthsInCurrentYear[monthsInCurrentYear.length - 1]);

const getDataset = useCallback(
function getDataset(year: string, month: string) {
Expand Down

0 comments on commit 6a12d5a

Please sign in to comment.