mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: add names back in live tab
This commit is contained in:
parent
ed9dd523ba
commit
4b15e9707d
6 changed files with 31 additions and 4 deletions
|
|
@ -73,13 +73,16 @@
|
||||||
v-if="!player.bot"
|
v-if="!player.bot"
|
||||||
:to="{
|
:to="{
|
||||||
name: 'summoner',
|
name: 'summoner',
|
||||||
params: { region: $route.params.region, name: player.summonerName },
|
params: {
|
||||||
|
region: $route.params.region,
|
||||||
|
name: player.gameName + '-' + player.tagLine,
|
||||||
|
},
|
||||||
}"
|
}"
|
||||||
:class="[
|
:class="[
|
||||||
player.summonerId === account.id ? 'text-yellow-500' : 'hover:text-blue-200',
|
player.summonerId === account.id ? 'text-yellow-500' : 'hover:text-blue-200',
|
||||||
]"
|
]"
|
||||||
class="font-semibold"
|
class="font-semibold"
|
||||||
>{{ player.summonerName }}</router-link
|
>{{ player.gameName + '#' + player.tagLine }}</router-link
|
||||||
>
|
>
|
||||||
<div :class="[ally ? 'text-teal-300 ' : 'text-red-400 ']" class="text-xs">
|
<div :class="[ally ? 'text-teal-300 ' : 'text-red-400 ']" class="text-xs">
|
||||||
{{ player.champion.name }}
|
{{ player.champion.name }}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,12 @@ class LiveMatchSerializer extends MatchSerializer {
|
||||||
redRoles = super.getTeamRoles(redTeam)
|
redRoles = super.getTeamRoles(redTeam)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Accounts
|
||||||
|
const requestsAccounts = liveMatch.participants.map((p) =>
|
||||||
|
SummonerService.getAccount(p.puuid, region)
|
||||||
|
)
|
||||||
|
const accounts = await Promise.all(requestsAccounts)
|
||||||
|
|
||||||
// Ranks
|
// Ranks
|
||||||
const requestsRanks = liveMatch.participants.map((p) =>
|
const requestsRanks = liveMatch.participants.map((p) =>
|
||||||
SummonerService.getRanked(p.summonerId, region)
|
SummonerService.getRanked(p.summonerId, region)
|
||||||
|
|
@ -61,6 +67,7 @@ class LiveMatchSerializer extends MatchSerializer {
|
||||||
return {
|
return {
|
||||||
...player,
|
...player,
|
||||||
role,
|
role,
|
||||||
|
...accounts[index],
|
||||||
rank: ranks[index],
|
rank: ranks[index],
|
||||||
champion: this.getChampion(player.championId),
|
champion: this.getChampion(player.championId),
|
||||||
perks,
|
perks,
|
||||||
|
|
|
||||||
|
|
@ -207,6 +207,7 @@ export interface SerializedLiveMatchPlayer {
|
||||||
spell1Id: number
|
spell1Id: number
|
||||||
spell2Id: number
|
spell2Id: number
|
||||||
summonerId: string
|
summonerId: string
|
||||||
summonerName: string
|
gameName?: string
|
||||||
|
tagLine?: string
|
||||||
teamId: number
|
teamId: number
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,4 +28,15 @@ export default class AccountEndpoint {
|
||||||
'riot'
|
'riot'
|
||||||
).execute()
|
).execute()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public byPuuid(puuid: string, region: string): Promise<AccountDto> {
|
||||||
|
return new JaxRequest(
|
||||||
|
getRiotRegion(region),
|
||||||
|
this.config,
|
||||||
|
`account/v1/accounts/by-puuid/${puuid}`,
|
||||||
|
this.limiter,
|
||||||
|
36000,
|
||||||
|
'riot'
|
||||||
|
).execute()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ export interface CurrentGameParticipantDTO {
|
||||||
profileIconId: number
|
profileIconId: number
|
||||||
bot: boolean
|
bot: boolean
|
||||||
teamId: number
|
teamId: number
|
||||||
summonerName: string
|
|
||||||
summonerId: string
|
summonerId: string
|
||||||
|
puuid: string
|
||||||
spell1Id: number
|
spell1Id: number
|
||||||
spell2Id: number
|
spell2Id: number
|
||||||
gameCustomizationObjects: GameCustomizationObjectDTO[]
|
gameCustomizationObjects: GameCustomizationObjectDTO[]
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import Summoner from 'App/Models/Summoner'
|
||||||
import { PlayerRankParsed } from 'App/Parsers/ParsedType'
|
import { PlayerRankParsed } from 'App/Parsers/ParsedType'
|
||||||
import MatchPlayerRank from 'App/Models/MatchPlayerRank'
|
import MatchPlayerRank from 'App/Models/MatchPlayerRank'
|
||||||
import { ACCOUNT_NAME_DELIMITER } from 'App/helpers'
|
import { ACCOUNT_NAME_DELIMITER } from 'App/helpers'
|
||||||
|
import { AccountDto } from 'App/Services/Jax/src/Endpoints/AccountEndpoint'
|
||||||
|
|
||||||
export interface LeagueEntriesByQueue {
|
export interface LeagueEntriesByQueue {
|
||||||
soloQ?: LeagueEntryByQueue
|
soloQ?: LeagueEntryByQueue
|
||||||
|
|
@ -81,6 +82,10 @@ class SummonerService {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getAccount(puuid: string, region: string): Promise<AccountDto | null> {
|
||||||
|
return Jax.Account.byPuuid(puuid, region)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the full list of old and actual summoner names
|
* Return the full list of old and actual summoner names
|
||||||
* @param account of the summoner
|
* @param account of the summoner
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue