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"
|
||||
:to="{
|
||||
name: 'summoner',
|
||||
params: { region: $route.params.region, name: player.summonerName },
|
||||
params: {
|
||||
region: $route.params.region,
|
||||
name: player.gameName + '-' + player.tagLine,
|
||||
},
|
||||
}"
|
||||
:class="[
|
||||
player.summonerId === account.id ? 'text-yellow-500' : 'hover:text-blue-200',
|
||||
]"
|
||||
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">
|
||||
{{ player.champion.name }}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,12 @@ class LiveMatchSerializer extends MatchSerializer {
|
|||
redRoles = super.getTeamRoles(redTeam)
|
||||
}
|
||||
|
||||
// Accounts
|
||||
const requestsAccounts = liveMatch.participants.map((p) =>
|
||||
SummonerService.getAccount(p.puuid, region)
|
||||
)
|
||||
const accounts = await Promise.all(requestsAccounts)
|
||||
|
||||
// Ranks
|
||||
const requestsRanks = liveMatch.participants.map((p) =>
|
||||
SummonerService.getRanked(p.summonerId, region)
|
||||
|
|
@ -61,6 +67,7 @@ class LiveMatchSerializer extends MatchSerializer {
|
|||
return {
|
||||
...player,
|
||||
role,
|
||||
...accounts[index],
|
||||
rank: ranks[index],
|
||||
champion: this.getChampion(player.championId),
|
||||
perks,
|
||||
|
|
|
|||
|
|
@ -207,6 +207,7 @@ export interface SerializedLiveMatchPlayer {
|
|||
spell1Id: number
|
||||
spell2Id: number
|
||||
summonerId: string
|
||||
summonerName: string
|
||||
gameName?: string
|
||||
tagLine?: string
|
||||
teamId: number
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,4 +28,15 @@ export default class AccountEndpoint {
|
|||
'riot'
|
||||
).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
|
||||
bot: boolean
|
||||
teamId: number
|
||||
summonerName: string
|
||||
summonerId: string
|
||||
puuid: string
|
||||
spell1Id: number
|
||||
spell2Id: number
|
||||
gameCustomizationObjects: GameCustomizationObjectDTO[]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import Summoner from 'App/Models/Summoner'
|
|||
import { PlayerRankParsed } from 'App/Parsers/ParsedType'
|
||||
import MatchPlayerRank from 'App/Models/MatchPlayerRank'
|
||||
import { ACCOUNT_NAME_DELIMITER } from 'App/helpers'
|
||||
import { AccountDto } from 'App/Services/Jax/src/Endpoints/AccountEndpoint'
|
||||
|
||||
export interface LeagueEntriesByQueue {
|
||||
soloQ?: LeagueEntryByQueue
|
||||
|
|
@ -81,6 +82,10 @@ class SummonerService {
|
|||
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
|
||||
* @param account of the summoner
|
||||
|
|
|
|||
Loading…
Reference in a new issue