Fix a couple crashes with prepared maps feature Closes #1862

This commit is contained in:
Kalle 2024-08-30 00:24:20 +03:00
parent 45a6adf540
commit 2cee6a96ca
2 changed files with 7 additions and 1 deletions

View File

@ -546,7 +546,11 @@ function teamCountAdjustedBracketData({
// RR & swiss are different because for those the amount of participants won't affect the amount of rounds
case "round_robin":
case "swiss":
return bracket.data;
// 10 to ensure a full bracket gets generated even if registration is underway
return tournament.generateMatchesData(
nullFilledArray(10).map((_, i) => i + 1),
bracket.type,
);
case "single_elimination":
return tournament.generateMatchesData(
nullFilledArray(teamCount).map((_, i) => i + 1),

View File

@ -540,6 +540,7 @@ function BracketStarter({
close={close}
bracket={bracket}
bracketIdx={bracketIdx}
key={bracketIdx}
/>
) : null}
<Button
@ -587,6 +588,7 @@ function MapPreparer({
bracket={bracket}
bracketIdx={bracketIdx}
isPreparing
key={bracketIdx}
/>
) : null}
<div className="stack sm horizontal ml-auto">