mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: use puuid instead of old summonerId for logic in frontend pages
This commit is contained in:
parent
bd2816bb7a
commit
c0cdc342d0
5 changed files with 15 additions and 15 deletions
|
|
@ -62,12 +62,12 @@ export default {
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
allyTeam() {
|
allyTeam() {
|
||||||
return this.data.blueTeam.players.some((p) => p.summonerId === this.account.id)
|
return this.data.blueTeam.players.some((p) => p.summonerPuuid === this.account.puuid)
|
||||||
? this.data.blueTeam
|
? this.data.blueTeam
|
||||||
: this.data.redTeam
|
: this.data.redTeam
|
||||||
},
|
},
|
||||||
enemyTeam() {
|
enemyTeam() {
|
||||||
return this.data.blueTeam.players.some((p) => p.summonerId === this.account.id)
|
return this.data.blueTeam.players.some((p) => p.summonerPuuid === this.account.puuid)
|
||||||
? this.data.redTeam
|
? this.data.redTeam
|
||||||
: this.data.blueTeam
|
: this.data.blueTeam
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@
|
||||||
params: { region: $route.params.region, name: player.name },
|
params: { region: $route.params.region, name: player.name },
|
||||||
}"
|
}"
|
||||||
:class="{
|
:class="{
|
||||||
'font-semibold text-yellow-400': account.id === player.summonerId,
|
'font-semibold text-yellow-400': account.puuid === player.summonerPuuid,
|
||||||
}"
|
}"
|
||||||
class="text-overflow w-[5.5rem] overflow-hidden whitespace-nowrap text-left text-xs text-white hover:text-blue-200"
|
class="text-overflow w-[5.5rem] overflow-hidden whitespace-nowrap text-left text-xs text-white hover:text-blue-200"
|
||||||
>{{ nameWithoutTagLine(player.name) }}</router-link
|
>{{ nameWithoutTagLine(player.name) }}</router-link
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<ul class="w-1/2 text-left">
|
<ul class="w-1/2 text-left">
|
||||||
<li
|
<li
|
||||||
v-for="(ally, index) in allyTeam"
|
v-for="(ally, index) in allyTeam"
|
||||||
:key="ally.summonerId"
|
:key="ally.puuid"
|
||||||
:class="index % 2 === 0 ? 'accent-ally' : 'ally'"
|
:class="index % 2 === 0 ? 'accent-ally' : 'ally'"
|
||||||
class="flex items-center px-5 py-1 leading-loose"
|
class="flex items-center px-5 py-1 leading-loose"
|
||||||
>
|
>
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
name: 'summoner',
|
name: 'summoner',
|
||||||
params: { region: $route.params.region, name: ally.riotId.replaceAll('#', '-') },
|
params: { region: $route.params.region, name: ally.riotId.replaceAll('#', '-') },
|
||||||
}"
|
}"
|
||||||
:class="[ally.summonerId === account.id ? 'text-white' : 'text-blue-200']"
|
:class="[ally.puuid === account.puuid ? 'text-white' : 'text-blue-200']"
|
||||||
class="relative ml-2 hover:text-white"
|
class="relative ml-2 hover:text-white"
|
||||||
>{{ ally.riotId }}</router-link
|
>{{ ally.riotId }}</router-link
|
||||||
>
|
>
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
<ul class="w-1/2 text-right">
|
<ul class="w-1/2 text-right">
|
||||||
<li
|
<li
|
||||||
v-for="(enemy, index) in enemyTeam"
|
v-for="(enemy, index) in enemyTeam"
|
||||||
:key="enemy.summonerId"
|
:key="enemy.puuid"
|
||||||
:class="index % 2 === 0 ? 'accent-enemy' : 'enemy'"
|
:class="index % 2 === 0 ? 'accent-enemy' : 'enemy'"
|
||||||
class="flex items-center justify-end px-5 py-1 leading-loose"
|
class="flex items-center justify-end px-5 py-1 leading-loose"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
>
|
>
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="text-left">
|
<tr class="text-left">
|
||||||
<th :class="[ally ? 'text-teal-400 ' : 'text-red-400 ']" class="w-team font-semibold">
|
<th :class="[ally ? 'text-teal-400' : 'text-red-400']" class="w-team font-semibold">
|
||||||
{{ ally ? 'Ally' : 'Enemy' }} Team
|
{{ ally ? 'Ally' : 'Enemy' }} Team
|
||||||
</th>
|
</th>
|
||||||
<th class="w-ranked text-sm font-normal text-blue-200">SoloQ Stats</th>
|
<th class="w-ranked text-sm font-normal text-blue-200">SoloQ Stats</th>
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<tbody v-if="liveLoaded">
|
<tbody v-if="liveLoaded">
|
||||||
<tr
|
<tr
|
||||||
v-for="(player, index) in team"
|
v-for="(player, index) in team"
|
||||||
:key="player.summonerId"
|
:key="player.puuid"
|
||||||
:style="getCSSVars(player.championId)"
|
:style="getCSSVars(player.championId)"
|
||||||
class="live-team-row relative"
|
class="live-team-row relative"
|
||||||
>
|
>
|
||||||
|
|
@ -43,12 +43,12 @@
|
||||||
:style="{
|
:style="{
|
||||||
backgroundImage: `url('https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/champion-icons/${player.championId}.png')`,
|
backgroundImage: `url('https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/champion-icons/${player.championId}.png')`,
|
||||||
}"
|
}"
|
||||||
:class="borderChampion(player.summonerId)"
|
:class="borderChampion(player.puuid)"
|
||||||
class="relative ml-2 h-12 w-12 rounded-full border-2 bg-blue-1000 bg-cover bg-center"
|
class="relative ml-2 h-12 w-12 rounded-full border-2 bg-blue-1000 bg-cover bg-center"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="player.role && player.role !== 'NONE'"
|
v-if="player.role && player.role !== 'NONE'"
|
||||||
:class="borderChampion(player.summonerId)"
|
:class="borderChampion(player.puuid)"
|
||||||
class="absolute rounded-full border bg-blue-1000 p-0.5"
|
class="absolute rounded-full border bg-blue-1000 p-0.5"
|
||||||
style="bottom: -5px; right: -5px"
|
style="bottom: -5px; right: -5px"
|
||||||
>
|
>
|
||||||
|
|
@ -79,12 +79,12 @@
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
:class="[
|
:class="[
|
||||||
player.summonerId === account.id ? 'text-yellow-500' : 'hover:text-blue-200',
|
player.puuid === account.puuid ? 'text-yellow-500' : 'hover:text-blue-200',
|
||||||
]"
|
]"
|
||||||
class="font-semibold"
|
class="font-semibold"
|
||||||
>{{ player.gameName + '#' + player.tagLine }}</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 }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -270,8 +270,8 @@ export default {
|
||||||
|
|
||||||
return this.live.bannedChampions.find((b) => b.pickTurn === toFind && b.teamId === teamId)
|
return this.live.bannedChampions.find((b) => b.pickTurn === toFind && b.teamId === teamId)
|
||||||
},
|
},
|
||||||
borderChampion(id) {
|
borderChampion(puuid) {
|
||||||
if (id === this.account.id) {
|
if (puuid === this.account.puuid) {
|
||||||
return 'border-yellow-500'
|
return 'border-yellow-500'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export const liveGame = {
|
||||||
return this.current ? this.current.gameStartTime : 0
|
return this.current ? this.current.gameStartTime : 0
|
||||||
},
|
},
|
||||||
teamColor() {
|
teamColor() {
|
||||||
return this.current.participants.find((p) => p.summonerId === this.account.id).teamId
|
return this.current.participants.find((p) => p.puuid === this.account.puuid).teamId
|
||||||
},
|
},
|
||||||
...mapState({
|
...mapState({
|
||||||
account: (state) => state.summoner.basic.account,
|
account: (state) => state.summoner.basic.account,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue