mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-03-21 18:04:10 -05:00
Update SplatNet 3 types
This commit is contained in:
parent
45c315978d
commit
19f9ba74ec
|
|
@ -258,6 +258,8 @@ function createApp(
|
|||
|
||||
if (fest_vote_status) {
|
||||
for (const team of fest_vote_status.teams) {
|
||||
if (!team.votes || !team.preVotes) continue;
|
||||
|
||||
for (const player of team.votes.nodes) {
|
||||
if (player.userIcon.url !== friend.userIcon.url) continue;
|
||||
|
||||
|
|
@ -273,7 +275,7 @@ function createApp(
|
|||
}
|
||||
}
|
||||
|
||||
if (!match.splatoon3_fest_team) {
|
||||
if (!match.splatoon3_fest_team && fest_vote_status.undecidedVotes) {
|
||||
match.splatoon3_fest_team = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -366,7 +368,7 @@ function createApp(
|
|||
|
||||
for (const team of fest_vote_status.teams) {
|
||||
const schedule_team = schedules.currentFest?.teams.find(t => t.id === team.id);
|
||||
if (!schedule_team) continue; // Shouldn't ever happen
|
||||
if (!schedule_team || !team.votes || !team.preVotes) continue; // Shouldn't ever happen
|
||||
|
||||
for (const player of team.votes.nodes) {
|
||||
if (player.userIcon.url !== friend.userIcon.url) continue;
|
||||
|
|
@ -385,7 +387,7 @@ function createApp(
|
|||
}
|
||||
}
|
||||
|
||||
if (!match_splatnet3_fest_team) {
|
||||
if (!match_splatnet3_fest_team && fest_vote_status.undecidedVotes) {
|
||||
match_splatnet3_fest_team = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,13 +137,13 @@ export default class SplatNet3Monitor extends EmbeddedLoop {
|
|||
|
||||
// Identify the user by their icon as the vote list doesn't have friend IDs
|
||||
let fest_team = this.cached_voting_status?.data.fest?.teams
|
||||
.find(t => t.votes.nodes.find(f => f.userIcon.url === friend?.userIcon.url));
|
||||
.find(t => t.votes?.nodes.find(f => f.userIcon.url === friend?.userIcon.url));
|
||||
|
||||
if (this.fest && friend && (!this.cached_voting_status || (friend?.vsMode?.mode === 'FEST' && !fest_team))) {
|
||||
if (this.fest && friend && (!this.cached_voting_status || (friend.vsMode?.mode === 'FEST' && !fest_team))) {
|
||||
this.cached_voting_status = await this.splatnet?.getFestVotingStatus(this.fest.id) ?? null;
|
||||
|
||||
fest_team = this.cached_voting_status?.data.fest?.teams
|
||||
.find(t => t.votes.nodes.find(f => f.userIcon.url === friend?.userIcon.url));
|
||||
.find(t => t.votes?.nodes.find(f => f.userIcon.url === friend?.userIcon.url));
|
||||
}
|
||||
|
||||
this.fest_team_voting_status = fest_team ?? null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user