From e8c9bb09f9424f0c75d3884db2fa0a5eff91107e Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 1 Mar 2026 21:38:44 +0200 Subject: [PATCH] Hide lfg team name if isPlaceholder --- .../TournamentLFGRepository.server.ts | 15 ++++++++------- .../tournament-lfg/components/LFGGroupCard.tsx | 1 - .../loaders/to.$id.looking.server.ts | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/features/tournament-lfg/TournamentLFGRepository.server.ts b/app/features/tournament-lfg/TournamentLFGRepository.server.ts index ee27c1037..783f64a8e 100644 --- a/app/features/tournament-lfg/TournamentLFGRepository.server.ts +++ b/app/features/tournament-lfg/TournamentLFGRepository.server.ts @@ -163,13 +163,14 @@ export function mergeTeams({ "Group has too many members after merge", ); - if (memberCount >= maxGroupSize) { - await trx - .updateTable("TournamentTeam") - .set({ isLooking: 0 }) - .where("id", "=", survivingTeamId) - .execute(); - } + await trx + .updateTable("TournamentTeam") + .set({ + isLooking: memberCount >= maxGroupSize ? 0 : undefined, + isPlaceholder: 0, + }) + .where("id", "=", survivingTeamId) + .execute(); }); } diff --git a/app/features/tournament-lfg/components/LFGGroupCard.tsx b/app/features/tournament-lfg/components/LFGGroupCard.tsx index 69e8da5a9..e7cd589e0 100644 --- a/app/features/tournament-lfg/components/LFGGroupCard.tsx +++ b/app/features/tournament-lfg/components/LFGGroupCard.tsx @@ -47,7 +47,6 @@ export type LFGGroup = { usersRole: "OWNER" | "MANAGER" | "REGULAR" | null; }; -// xxx: make sure we don't show team name if isPlaceholder // xxx: "cancel" & "save" buttons off export function LFGGroupCard({ group, diff --git a/app/features/tournament-lfg/loaders/to.$id.looking.server.ts b/app/features/tournament-lfg/loaders/to.$id.looking.server.ts index 9dad8d51b..318e48c32 100644 --- a/app/features/tournament-lfg/loaders/to.$id.looking.server.ts +++ b/app/features/tournament-lfg/loaders/to.$id.looking.server.ts @@ -21,8 +21,8 @@ export const loader = async ({ params }: LoaderFunctionArgs) => { return { id: group.id, isPlaceholder: Boolean(group.isPlaceholder), - teamName: group.teamName ?? null, - teamAvatarUrl: group.teamAvatarUrl ?? null, + teamName: group.isPlaceholder ? null : (group.teamName ?? null), + teamAvatarUrl: group.isPlaceholder ? null : (group.teamAvatarUrl ?? null), note: group.note ?? null, members, usersRole: members.find((m) => m.id === user?.id)?.role ?? null,