From fb05186229c63b7d8013e27f534b05f15aef2ef3 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Wed, 19 Feb 2025 22:23:46 +0200 Subject: [PATCH] Remove "This player is already in a team" alert --- .../tournament/routes/to.$id.admin.tsx | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/app/features/tournament/routes/to.$id.admin.tsx b/app/features/tournament/routes/to.$id.admin.tsx index 403517183..c4945077a 100644 --- a/app/features/tournament/routes/to.$id.admin.tsx +++ b/app/features/tournament/routes/to.$id.admin.tsx @@ -27,7 +27,6 @@ import { tournamentEditPage, tournamentPage, } from "~/utils/urls"; -import { Alert } from "../../../components/Alert"; import { Dialog } from "../../../components/Dialog"; import { BracketProgressionSelector } from "../../calendar/components/BracketProgressionSelector"; import { useTournament } from "./to.$id"; @@ -209,7 +208,6 @@ function TeamActions() { ? actions.find((a) => a.when.length === 0)! : actions[0], ); - const [selectedUserId, setSelectedUserId] = React.useState(); const selectedTeam = tournament.teamById(selectedTeamId); @@ -260,18 +258,6 @@ function TeamActions() { return true; }); - const showAlreadyInTeamAlert = () => { - if (selectedAction.type !== "ADD_MEMBER") return false; - if ( - !selectedUserId || - !tournament.teamMemberOfByUser({ id: selectedUserId }) - ) { - return false; - } - - return true; - }; - return (
a.type === e.target.value)!, ); - setSelectedUserId(undefined); }} > {actionsToShow.map((action) => ( @@ -339,11 +324,7 @@ function TeamActions() { {selectedAction.inputs.includes("USER") ? (
- setSelectedUserId(newUser.id)} - /> +
) : null} {selectedAction.inputs.includes("BRACKET") ? ( @@ -387,9 +368,6 @@ function TeamActions() { Go
- {showAlreadyInTeamAlert() ? ( - This player is already in a team - ) : null}
); }