From 150c88448515a4ed81a23a9ba54b6e1904a8ccc9 Mon Sep 17 00:00:00 2001 From: Kalista Payne Date: Wed, 6 May 2026 22:07:21 -0500 Subject: [PATCH] fix(scoring): deduct 1 minimum when unscoring streak Daily --- website/common/script/ops/scoreTask.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/common/script/ops/scoreTask.js b/website/common/script/ops/scoreTask.js index 2128563760..694db3a02d 100644 --- a/website/common/script/ops/scoreTask.js +++ b/website/common/script/ops/scoreTask.js @@ -142,8 +142,8 @@ function _addPoints (user, task, stats, direction, delta) { const currStreak = direction === 'down' ? task.streak - 1 : task.streak; const streakBonus = currStreak / 100 + 1; // eg, 1-day streak is 1.01, 2-day is 1.02, etc let afterStreak = gpMod * streakBonus; - if (afterStreak - gpMod < 1) { - afterStreak = gpMod + 1; // min streak bonus of +1 + if (Math.abs(afterStreak - gpMod) < 1) { + afterStreak = direction === 'down' ? gpMod - 1 : gpMod + 1; // min streak bonus of +1 } if (currStreak > 0 && gpMod > 0) { // keep this on-hand for later, so we can notify streak-bonus