From 211562a0d6699664d75f2c450e0d5249fcb907e3 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Wed, 16 Sep 2020 09:30:26 -0400 Subject: [PATCH] Don't send webhooks for duplicate votes --- src/routes/voteOnSponsorTime.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/routes/voteOnSponsorTime.js b/src/routes/voteOnSponsorTime.js index e8c4edc..b774e12 100644 --- a/src/routes/voteOnSponsorTime.js +++ b/src/routes/voteOnSponsorTime.js @@ -355,17 +355,19 @@ async function voteOnSponsorTime(req, res) { res.sendStatus(200); - sendWebhooks({ - UUID, - nonAnonUserID, - voteTypeEnum, - isVIP, - isOwnSubmission, - row, - category, - incrementAmount, - oldIncrementAmount - }); + if (incrementAmount - oldIncrementAmount !== 0) { + sendWebhooks({ + UUID, + nonAnonUserID, + voteTypeEnum, + isVIP, + isOwnSubmission, + row, + category, + incrementAmount, + oldIncrementAmount + }); + } } catch (err) { logger.error(err);