Skip to content

Commit

Permalink
Make tournament organization member names show in the chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Sendouc committed Oct 20, 2024
1 parent a04d67b commit d554ae3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/features/tournament-bracket/components/StartedMatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ function StartedMatchTabs({
return Object.fromEntries(
[
...data.match.players.map((p) => ({ ...p, title: undefined })),
...(tournament.ctx.organization?.members ?? []).map((m) => ({
...m,
title: m.role === "STREAMER" ? "Stream" : "TO",
})),
...tournament.ctx.staff.map((s) => ({
...s,
title: s.role === "STREAMER" ? "Stream" : "TO",
Expand Down Expand Up @@ -663,7 +667,7 @@ function StartedMatchTabs({
chat={chat}
onMount={onChatMount}
onUnmount={onChatUnmount}
missingUserName="TO"
missingUserName="???"
/>
) : null}
</>
Expand Down
3 changes: 2 additions & 1 deletion app/features/tournament/TournamentRepository.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ export async function findById(id: number) {
.select([
"TournamentOrganizationMember.userId",
"TournamentOrganizationMember.role",
"User.username",
...COMMON_USER_FIELDS,
userChatNameColor,
])
.whereRef(
"TournamentOrganizationMember.organizationId",
Expand Down

0 comments on commit d554ae3

Please sign in to comment.