Fix GroupTable breaking when there were more groups than colors

This commit is contained in:
Aurora Lahtela 2023-03-04 10:12:28 +02:00
parent e9496e924f
commit 5654710ed6

View File

@ -21,7 +21,8 @@ const GroupTable = ({groups, colors}) => {
if (groups[i].color) { if (groups[i].color) {
return nightModeEnabled ? withReducedSaturation(groups[i].color) : 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 ( return (