Skip to content

Commit

Permalink
vinvoor: default value in absent of seasons
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed Oct 4, 2024
1 parent 1269ecd commit c0d0776
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vinvoor/src/overview/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export const Overview = () => {
if (currentSeason.id === 1 && seasonsQuery.data) {
const seasons = [...seasonsQuery.data];
seasons.sort((a, b) => a.start.getTime() - b.start.getTime());
setHeatmapDates([seasons[1].start, new Date()]);
setHeatmapDates([
seasons.length > 1 ? seasons[1].start : seasons[0].start,
new Date(),
]);
} else {
setHeatmapDates([currentSeason.start, currentSeason.end]);
}
Expand Down

0 comments on commit c0d0776

Please sign in to comment.