mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: #12090, dont award disabled rewards
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user