From 17499adc5cff05532ce9046ea4e98c4832107616 Mon Sep 17 00:00:00 2001 From: "Ronald M. Clifford" Date: Fri, 30 Sep 2022 13:22:22 -0700 Subject: [PATCH] Don't update events whose match time has passed. --- src/models/challenge.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/challenge.js b/src/models/challenge.js index 00ed41fb..84e9b59e 100644 --- a/src/models/challenge.js +++ b/src/models/challenge.js @@ -2771,14 +2771,14 @@ class Challenge { try { if (this.details.discordEvent) { // Set Discord event. - if (this.details.discordEvent.isCompleted()) { + if (this.details.discordEvent.isCompleted() || this.details.matchTime.getTime() + 60 * 60 * 1000 >= Date.now()) { this.details.discordEvent = void 0; } else if (!this.details.matchTime) { await this.details.discordEvent.delete(); this.details.discordEvent = void 0; } else if (matchTimeUpdate) { - if (this.details.confirmed || this.details.matchTime < new Date()) { + if (this.details.confirmed || this.details.matchTime.getTime() < Date.now()) { await this.details.discordEvent.edit({ name: `${this.details.title ? `${this.details.title} - ` : ""}${this.challengingTeam.name} vs ${this.challengedTeam.name}`, description: eventParameters.join("\n"),