Fix draft round showing Infinity before draft starts

When draftSlots is empty (pre-draft state), dividing by zero caused
Math.ceil to return Infinity. Guard the division to fall back to round 1.

https://claude.ai/code/session_017mLmGc5wTrESaDeRQHkSPy
This commit is contained in:
Claude 2026-02-20 19:06:06 +00:00
parent 47b69ce9cf
commit 4e32463a7e
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -150,7 +150,7 @@ export default function DraftBoard() {
{season.league.name} - {season.year} Draft Board
</h1>
<div className="flex gap-4 text-sm text-muted-foreground mt-1">
<span>Round: {Math.ceil(currentPick / totalTeams)}</span>
<span>Round: {totalTeams > 0 ? Math.ceil(currentPick / totalTeams) : 1}</span>
<span>Pick: {currentPick}</span>
<span className="capitalize">
{season.status.replace("_", " ")}

View file

@ -654,7 +654,7 @@ export default function DraftRoom() {
};
// Calculate current round
const currentRound = Math.ceil(currentPick / draftSlots.length);
const currentRound = draftSlots.length > 0 ? Math.ceil(currentPick / draftSlots.length) : 1;
// Determine whose turn it is
const totalTeams = draftSlots.length;