From 5654710ed606498fbc3b27b92f3c59215bbba17a Mon Sep 17 00:00:00 2001 From: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Sat, 4 Mar 2023 10:12:28 +0200 Subject: [PATCH] Fix GroupTable breaking when there were more groups than colors --- Plan/react/dashboard/src/components/table/GroupTable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plan/react/dashboard/src/components/table/GroupTable.js b/Plan/react/dashboard/src/components/table/GroupTable.js index 686c95856..d6f6017b4 100644 --- a/Plan/react/dashboard/src/components/table/GroupTable.js +++ b/Plan/react/dashboard/src/components/table/GroupTable.js @@ -21,7 +21,8 @@ const GroupTable = ({groups, colors}) => { if (groups[i].color) { return nightModeEnabled ? withReducedSaturation(groups[i].color) : groups[i].color; } - return nightModeEnabled ? withReducedSaturation(colors[i]) : colors[i]; + const index = i % colors.length; + return nightModeEnabled ? withReducedSaturation(colors[index]) : colors[index]; } return (