From 457f747f7a30c8da7dda911fd7edfdbbc879dcff Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 18 Dec 2025 20:11:09 +0200 Subject: [PATCH] Allow locking round robin matches for cast --- .../actions/to.$id.matches.$mid.server.ts | 5 +++-- .../tournament-bracket/components/Bracket/RoundRobin.tsx | 2 +- app/features/tournament-bracket/components/CastInfo.tsx | 9 +++++---- .../tournament-bracket/routes/to.$id.matches.$mid.tsx | 4 +--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/features/tournament-bracket/actions/to.$id.matches.$mid.server.ts b/app/features/tournament-bracket/actions/to.$id.matches.$mid.server.ts index 3e0799de3..34aed6a2b 100644 --- a/app/features/tournament-bracket/actions/to.$id.matches.$mid.server.ts +++ b/app/features/tournament-bracket/actions/to.$id.matches.$mid.server.ts @@ -1,5 +1,6 @@ import type { ActionFunction } from "@remix-run/node"; import { sql } from "~/db/sql"; +import { TournamentMatchStatus } from "~/db/tables"; import { requireUser } from "~/features/auth/core/user.server"; import * as ChatSystemMessage from "~/features/chat/ChatSystemMessage.server"; import * as TournamentRepository from "~/features/tournament/TournamentRepository.server"; @@ -556,8 +557,8 @@ export const action: ActionFunction = async ({ params, request }) => { "Not an organizer or streamer", ); - // can't lock, let's update their view to reflect that - if (match.opponentOne?.id && match.opponentTwo?.id) { + // can't lock if match status is not Locked (team(s) busy with previous match), let's update their view to reflect that + if (match.status !== TournamentMatchStatus.Locked) { return null; } diff --git a/app/features/tournament-bracket/components/Bracket/RoundRobin.tsx b/app/features/tournament-bracket/components/Bracket/RoundRobin.tsx index 6fa75e4bd..9506d7c37 100644 --- a/app/features/tournament-bracket/components/Bracket/RoundRobin.tsx +++ b/app/features/tournament-bracket/components/Bracket/RoundRobin.tsx @@ -28,7 +28,7 @@ export function RoundRobinBracket({ bracket }: { bracket: BracketType }) { }); return ( -
+

{groupName}

{data.matchIsOver && !data.endedEarly && data.results.length > 0 ? (