From befb3f69bd01dff481b948f8460511d3a37dde27 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 28 Dec 2019 23:25:57 -0500 Subject: [PATCH] Prevented overdownvoting --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c651fc5..9305eaa 100644 --- a/index.js +++ b/index.js @@ -344,7 +344,7 @@ app.get('/api/voteOnSponsorTime', function (req, res) { type = incrementAmount; } else if (row != null && (row.votes > 8 || row.views > 15) && incrementAmount < 0) { //increase the power of this downvote - incrementAmount = -10; + incrementAmount = -Math.abs(Math.min(10, row.votes + 2 - oldIncrementAmount)); type = incrementAmount; }