Skip to content

Node.js based forum software built for the modern web

fix: #12090, dont award disabled rewards

Barış Soner Uşaklıc1ae879d90b9
diff --git a/src/rewards/index.js b/src/rewards/index.js
index 49e88d1b09..477a290693 100644
--- a/src/rewards/index.js
+++ b/src/rewards/index.js
@@ -15,8 +15,9 @@ rewards.checkConditionAndRewardUser = async function (params) {
}
const ids = await getIDsByCondition(condition);
let rewardData = await getRewardDataByIDs(ids);
+ // filter disabled
+ rewardData = rewardData.filter(r => r && !(r.disabled === 'true' || r.disabled === true));
rewardData = await filterCompletedRewards(uid, rewardData);
- rewardData = rewardData.filter(Boolean);
if (!rewardData || !rewardData.length) {
return;
}