.
This commit is contained in:
1 parent
c5d296d403
commit
2250b6072e
22 files changed
+1719
-42
No files matched your search
@@ -53,9 +53,27 @@ export interface MatchDetailView {
|
||||
participants: ParticipantView[];
|
||||
teams: TeamView[];
|
||||
result?: {
|
||||
winner: string;
|
||||
winner?: string;
|
||||
winnerSide?: TeamSide;
|
||||
blueScore: number;
|
||||
redScore: number;
|
||||
riotMatchIds: string[];
|
||||
games: Array<{
|
||||
gameNumber: number;
|
||||
riotMatchId: string;
|
||||
winnerSide: TeamSide;
|
||||
gameCreation: number;
|
||||
gameDuration: number;
|
||||
participants: Array<{
|
||||
userId: string;
|
||||
side: TeamSide;
|
||||
championId: number;
|
||||
kills: number;
|
||||
deaths: number;
|
||||
assists: number;
|
||||
win: boolean;
|
||||
}>;
|
||||
}>;
|
||||
};
|
||||
prizes: string[];
|
||||
notices: string[];
|
||||
@@ -392,7 +410,7 @@ export function mapApiMatchToMatchDetail(match: ApiMatch): MatchDetailView {
|
||||
}),
|
||||
}));
|
||||
|
||||
const winnerTeam = match.result
|
||||
const winnerTeam = match.result?.winnerSide
|
||||
? teams.find((team) => team.side === match.result?.winnerSide)
|
||||
: undefined;
|
||||
|
||||
@@ -412,9 +430,16 @@ export function mapApiMatchToMatchDetail(match: ApiMatch): MatchDetailView {
|
||||
teams,
|
||||
result: match.result
|
||||
? {
|
||||
winner: winnerTeam?.name ?? sideLabel(match.result.winnerSide),
|
||||
winner: match.result.winnerSide
|
||||
? winnerTeam?.name ?? sideLabel(match.result.winnerSide)
|
||||
: undefined,
|
||||
winnerSide: match.result.winnerSide,
|
||||
blueScore: match.result.blueScore,
|
||||
redScore: match.result.redScore,
|
||||
riotMatchIds: match.result.riotMatchIds,
|
||||
games: [...(match.result.games ?? [])].sort(
|
||||
(left, right) => left.gameNumber - right.gameNumber,
|
||||
),
|
||||
}
|
||||
: undefined,
|
||||
prizes: match.prizes,
|
||||
|
||||
Reference in new issue
Block a user