From 67a162afd6e41d2c07d775143408dac0f91e642c Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 24 May 2026 16:31:21 +0300 Subject: [PATCH] Prevent leaving tournament team after reg has closed Closes #2850 --- .../actions/to.$id.register.server.ts | 4 ++ .../tournament/routes/to.$id.register.tsx | 59 ++++++++++++++----- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/app/features/tournament/actions/to.$id.register.server.ts b/app/features/tournament/actions/to.$id.register.server.ts index 07c0c7eb8..527159089 100644 --- a/app/features/tournament/actions/to.$id.register.server.ts +++ b/app/features/tournament/actions/to.$id.register.server.ts @@ -183,6 +183,10 @@ export const action: ActionFunction = async ({ request, params }) => { teamMemberOf.checkIns.length === 0, "You cannot leave after checking in", ); + errorToastIfFalsy( + tournament.registrationOpen, + "Registration has closed, contact the TO to leave the team", + ); await TournamentTeamRepository.leave({ teamId: teamMemberOf.id, diff --git a/app/features/tournament/routes/to.$id.register.tsx b/app/features/tournament/routes/to.$id.register.tsx index 1db01a842..7b772412d 100644 --- a/app/features/tournament/routes/to.$id.register.tsx +++ b/app/features/tournament/routes/to.$id.register.tsx @@ -259,21 +259,7 @@ function TournamentRegisterInfoTabs() { {isRegularMemberOfATeam ? (