mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +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);
|
const ids = await getIDsByCondition(condition);
|
||||||
let rewardData = await getRewardDataByIDs(ids);
|
let rewardData = await getRewardDataByIDs(ids);
|
||||||
|
// filter disabled
|
||||||
|
rewardData = rewardData.filter(r => r && !(r.disabled === 'true' || r.disabled === true));
|
||||||
rewardData = await filterCompletedRewards(uid, rewardData);
|
rewardData = await filterCompletedRewards(uid, rewardData);
|
||||||
rewardData = rewardData.filter(Boolean);
|
|
||||||
if (!rewardData || !rewardData.length) {
|
if (!rewardData || !rewardData.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user