From 521a3add7c72b4f068be761bc12bbbb5662aaaad Mon Sep 17 00:00:00 2001
From: Kalle <38327916+Sendouc@users.noreply.github.com>
Date: Sat, 9 May 2026 13:25:53 +0300
Subject: [PATCH] Do not show Own team/Opponent label when not in the match
Closes #3044
---
app/components/match-page/MatchActionTab.tsx | 2 +-
.../components/TournamentMatchActionTab.tsx | 2 +-
.../components/TournamentMatchTabs.tsx | 12 +++++++-----
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/app/components/match-page/MatchActionTab.tsx b/app/components/match-page/MatchActionTab.tsx
index 632ccad79..d20e1aa24 100644
--- a/app/components/match-page/MatchActionTab.tsx
+++ b/app/components/match-page/MatchActionTab.tsx
@@ -133,7 +133,7 @@ export function MatchActionTab({
diff --git a/app/features/tournament-match/components/TournamentMatchActionTab.tsx b/app/features/tournament-match/components/TournamentMatchActionTab.tsx
index c626d0d32..77d8bf766 100644
--- a/app/features/tournament-match/components/TournamentMatchActionTab.tsx
+++ b/app/features/tournament-match/components/TournamentMatchActionTab.tsx
@@ -21,7 +21,7 @@ export function TournamentMatchActionTab({
ownTeamId,
}: {
data: TournamentMatchLoaderData;
- ownTeamId: number;
+ ownTeamId: number | null;
}) {
const { t } = useTranslation(["q"]);
const tournament = useTournament();
diff --git a/app/features/tournament-match/components/TournamentMatchTabs.tsx b/app/features/tournament-match/components/TournamentMatchTabs.tsx
index 54b9cf462..3cc7ea12d 100644
--- a/app/features/tournament-match/components/TournamentMatchTabs.tsx
+++ b/app/features/tournament-match/components/TournamentMatchTabs.tsx
@@ -62,7 +62,12 @@ export function TournamentMatchTabs({
const opponentTwoId = teamTwo.id;
const pickBanTeams: [MatchPageTeam, MatchPageTeam] = [teamOne, teamTwo];
- const userTeamId = tournament.teamMemberOfByUser(user)?.id;
+ const userTournamentTeamId = tournament.teamMemberOfByUser(user)?.id;
+ const userTeamId =
+ userTournamentTeamId === opponentOneId ||
+ userTournamentTeamId === opponentTwoId
+ ? userTournamentTeamId
+ : null;
const pickBanData = resolveTimelinePickBanData(
data,
@@ -102,10 +107,7 @@ export function TournamentMatchTabs({
turnOfResult={turnOfResult}
/>
) : (
-
+
)
) : null}
{tabs.includes(TAB_KEYS.ADMIN) ? (