Use correct team avatar

This commit is contained in:
Kalle 2026-05-02 11:46:46 +03:00
parent bab2bdbb31
commit a54030ce8d
2 changed files with 14 additions and 8 deletions

View File

@ -85,6 +85,7 @@ export function TournamentMatchActionTab({
setEndingTeamIds.length > 0
? {
...buildSetEndingData({
tournament,
teams: [teamOne, teamTwo],
scores,
results: data.results,
@ -101,12 +102,12 @@ export function TournamentMatchActionTab({
{
id: teamOne.id,
name: teamOne.name,
avatar: teamOne.pickupAvatarUrl ?? undefined,
avatar: tournament.tournamentTeamLogoSrc(teamOne) ?? undefined,
},
{
id: teamTwo.id,
name: teamTwo.name,
avatar: teamTwo.pickupAvatarUrl ?? undefined,
avatar: tournament.tournamentTeamLogoSrc(teamTwo) ?? undefined,
},
]}
ownTeamId={ownTeamId}
@ -215,11 +216,13 @@ function useTournamentWeaponReport({
}
function buildSetEndingData({
tournament,
teams,
scores,
results,
opponentOneId,
}: {
tournament: ReturnType<typeof useTournament>;
teams: [
NonNullable<ReturnType<ReturnType<typeof useTournament>["teamById"]>>,
NonNullable<ReturnType<ReturnType<typeof useTournament>["teamById"]>>,
@ -303,11 +306,11 @@ function buildSetEndingData({
teams: {
alpha: {
name: teamOne.name,
avatar: teamOne.pickupAvatarUrl ?? undefined,
avatar: tournament.tournamentTeamLogoSrc(teamOne) ?? undefined,
},
bravo: {
name: teamTwo.name,
avatar: teamTwo.pickupAvatarUrl ?? undefined,
avatar: tournament.tournamentTeamLogoSrc(teamTwo) ?? undefined,
},
},
score: { alpha: scores[0], bravo: scores[1] },

View File

@ -108,15 +108,18 @@ function resolveTimelineTeams(
const teamOne = tournament.teamById(opponentOneId);
const teamTwo = tournament.teamById(opponentTwoId);
// xxx: is this correct?
return {
alpha: {
name: teamOne?.name ?? "?",
avatar: teamOne?.pickupAvatarUrl ?? undefined,
avatar: teamOne
? (tournament.tournamentTeamLogoSrc(teamOne) ?? undefined)
: undefined,
},
bravo: {
name: teamTwo?.name ?? "?",
avatar: teamTwo?.pickupAvatarUrl ?? undefined,
avatar: teamTwo
? (tournament.tournamentTeamLogoSrc(teamTwo) ?? undefined)
: undefined,
},
};
}
@ -402,7 +405,7 @@ function TournamentMatchRosterTab({
tournamentId: tournament.ctx.id,
tournamentTeamId: team.id,
}),
avatar: team.pickupAvatarUrl ?? undefined,
avatar: tournament.tournamentTeamLogoSrc(team) ?? undefined,
},
members: team.members.map((m) => ({
id: m.userId,