Skip to content

Commit

Permalink
Always use tams count at event when calculating picklist length (Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmeshulam committed Feb 9, 2025
1 parent a0429ce commit a219134
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import CompareModal from '../compare/compare-modal';
import { getDefaultPicklistLimit } from '../../../lib/utils/math';

interface DeliberationControlPanelProps {
teamCount: number;
compareTeams: Array<WithId<Team>>;
deliberation: WithId<JudgingDeliberation>;
startDeliberation: () => void;
Expand All @@ -38,6 +39,7 @@ interface DeliberationControlPanelProps {
}

const CategoryDeliberationControlPanel: React.FC<DeliberationControlPanelProps> = ({
teamCount,
compareTeams: teams,
deliberation,
startDeliberation,
Expand All @@ -61,7 +63,7 @@ const CategoryDeliberationControlPanel: React.FC<DeliberationControlPanelProps>
lockDeliberation={lockDeliberation}
disabled={
deliberation.status !== 'in-progress' ||
(deliberation.awards[category]?.length ?? 0) < getDefaultPicklistLimit(teams.length)
(deliberation.awards[category]?.length ?? 0) < getDefaultPicklistLimit(teamCount)
}
/>
<Divider />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const CategoryDeliberationLayout: React.FC = () => {
</Grid>
<Grid size={2.5}>
<CategoryDeliberationControlPanel
teamCount={teams.length}
compareTeams={teams.filter(team => eligibleTeams.includes(team._id))}
deliberation={deliberation}
category={category}
Expand Down

0 comments on commit a219134

Please sign in to comment.