Skip to content

Commit

Permalink
remove last month from select to prevent exception
Browse files Browse the repository at this point in the history
  • Loading branch information
nemanjam committed Dec 7, 2024
1 parent 15a4dc4 commit bb1807a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/charts/bar-chart-simple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const BarChartSimple: FC<Props> = ({ chartData, allMonths, month }) => {
sessionStorage.removeItem(scrollPositionKey);
}, []);

const selectMonthNames = allMonths.map((month) => month.name);
const selectMonthNames = allMonths.map((month) => month.name).slice(0, -1);

return (
<Card className="self-start">
Expand Down
3 changes: 2 additions & 1 deletion components/new-old-companies-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const scrollPositionKey = getScrollPositionKey('root');
const NewOldCompaniesCard: FC<Props> = ({ newOldCompanies, allMonths, month }) => {
const { replace } = useRouter();

const selectMonthNames = allMonths.map((month) => month.name);
// remove last item to prevent exception
const selectMonthNames = allMonths.map((month) => month.name).slice(0, -1);

const {
firstTimeCompanies,
Expand Down

0 comments on commit bb1807a

Please sign in to comment.