-
+ className="input__extra-small"
+ />
+
+ Maximum number of players that can be registered per team. Doesn't apply
+ to tournament organizers. Default is 6.
+
);
}
diff --git a/app/features/tournament-bracket/core/Tournament.ts b/app/features/tournament-bracket/core/Tournament.ts
index 574d373b5..f52b1b40e 100644
--- a/app/features/tournament-bracket/core/Tournament.ts
+++ b/app/features/tournament-bracket/core/Tournament.ts
@@ -863,24 +863,15 @@ export class Tournament {
}
/** what is the max amount of members teams can add in total? This limit doesn't apply to the organizer adding members to a team. */
- get maxTeamMemberCount() {
+ get maxMembersPerTeam() {
// special format
if (this.minMembersPerTeam !== 4) return this.minMembersPerTeam;
- if (this.isLeagueSignup || this.isLeagueDivision) return 8;
-
- // TODO: retire this hack by making it user configurable
- if (this.ctx.organization?.id === 19 && this.ctx.name.includes("FLUTI")) {
- return 8;
+ if (this.ctx.settings.maxMembersPerTeam) {
+ return this.ctx.settings.maxMembersPerTeam;
}
- const maxMembersBeforeStart = 6;
-
- if (this.hasStarted) {
- return maxMembersBeforeStart + 1;
- }
-
- return maxMembersBeforeStart;
+ return 6;
}
/** Is the regular check-in (check-in for the whole tournament) open at this time? */
diff --git a/app/features/tournament-bracket/routes/to.$id.brackets.tsx b/app/features/tournament-bracket/routes/to.$id.brackets.tsx
index 5c3dbd65b..d9b53c385 100644
--- a/app/features/tournament-bracket/routes/to.$id.brackets.tsx
+++ b/app/features/tournament-bracket/routes/to.$id.brackets.tsx
@@ -386,7 +386,7 @@ function AddSubsPopOver() {
}
const subsAvailableToAdd =
- tournament.maxTeamMemberCount - ownedTeam.members.length;
+ tournament.maxMembersPerTeam - ownedTeam.members.length;
const inviteLink = `${SENDOU_INK_BASE_URL}${tournamentJoinPage({
tournamentId: tournament.ctx.id,
diff --git a/app/features/tournament/actions/to.$id.join.server.ts b/app/features/tournament/actions/to.$id.join.server.ts
index c8a9fdfa1..4dda63789 100644
--- a/app/features/tournament/actions/to.$id.join.server.ts
+++ b/app/features/tournament/actions/to.$id.join.server.ts
@@ -68,7 +68,7 @@ export const action: ActionFunction = async ({ request, params }) => {
inviteCode,
teamToJoin,
userId: user.id,
- maxTeamSize: tournament.maxTeamMemberCount,
+ maxTeamSize: tournament.maxMembersPerTeam,
}) === "VALID",
"Cannot join this team or invite code is invalid",
);
diff --git a/app/features/tournament/routes/to.$id.join.tsx b/app/features/tournament/routes/to.$id.join.tsx
index b17d80bce..1a2e5b94f 100644
--- a/app/features/tournament/routes/to.$id.join.tsx
+++ b/app/features/tournament/routes/to.$id.join.tsx
@@ -28,7 +28,7 @@ export default function JoinTeamPage() {
inviteCode: data.inviteCode,
teamToJoin,
userId: user?.id,
- maxTeamSize: tournament.maxTeamMemberCount,
+ maxTeamSize: tournament.maxMembersPerTeam,
});
const textPrompt = () => {
diff --git a/app/features/tournament/routes/to.$id.register.tsx b/app/features/tournament/routes/to.$id.register.tsx
index 426e95d15..e57f9f363 100644
--- a/app/features/tournament/routes/to.$id.register.tsx
+++ b/app/features/tournament/routes/to.$id.register.tsx
@@ -971,7 +971,7 @@ function FillRoster({
);
const optionalMembers = Math.max(
- tournament.maxTeamMemberCount - ownTeamMembers.length - missingMembers,
+ tournament.maxMembersPerTeam - ownTeamMembers.length - missingMembers,
0,
);
@@ -992,7 +992,7 @@ function FillRoster({
});
})();
- const teamIsFull = ownTeamMembers.length >= tournament.maxTeamMemberCount;
+ const teamIsFull = ownTeamMembers.length >= tournament.maxMembersPerTeam;
const canAddMembers = !teamIsFull && tournament.registrationOpen;
return (
@@ -1085,7 +1085,7 @@ function FillRoster({