mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-01 07:10:46 -05:00
Prevent duplicate challenge notifications
This commit is contained in:
@@ -384,14 +384,16 @@
|
||||
if (this.info.isStarted && this.info.isJoined) {
|
||||
// Update the challenges
|
||||
if ('challenges' in this.updates) {
|
||||
this.$challenge.toggleClass('active', this.info.challenges.length > 0);
|
||||
if (this.info.challenges.length > 0) {
|
||||
this.$challengeUser.text("vs. " + this.info.challenges[0]);
|
||||
this.$challengeUserMenu.toggle(this.info.challenges.length > 1);
|
||||
this.$challengeUserMenu.html(this.renderChallengeUsers());
|
||||
this.toggleBoxVisibility(true);
|
||||
this.room.notifyOnce("Tournament challenges available", "Room: " + this.room.title, 'tournament-challenges');
|
||||
if (!this.$challenge.hasClass('active')) {
|
||||
this.room.notifyOnce("Tournament challenges available", "Room: " + this.room.title, 'tournament-challenges');
|
||||
}
|
||||
}
|
||||
this.$challenge.toggleClass('active', this.info.challenges.length > 0);
|
||||
}
|
||||
|
||||
if ('challengeBys' in this.updates) {
|
||||
@@ -408,12 +410,14 @@
|
||||
}
|
||||
|
||||
if ('challenged' in this.updates) {
|
||||
this.$challenged.toggleClass('active', !!this.info.challenged);
|
||||
if (this.info.challenged) {
|
||||
this.$challengedMessage.text("vs. " + this.info.challenged);
|
||||
this.toggleBoxVisibility(true);
|
||||
this.room.notifyOnce("Tournament challenge from " + this.info.challenged, "Room: " + this.room.title, 'tournament-challenged');
|
||||
if (!this.$challenged.hasClass('active')) {
|
||||
this.room.notifyOnce("Tournament challenge from " + this.info.challenged, "Room: " + this.room.title, 'tournament-challenged');
|
||||
}
|
||||
}
|
||||
this.$challenged.toggleClass('active', !!this.info.challenged);
|
||||
}
|
||||
|
||||
this.$noMatches.toggleClass('active',
|
||||
|
||||
Reference in New Issue
Block a user