fix: #12090, dont award disabled rewards

This commit is contained in:
Barış Soner Uşaklı
2023-10-16 19:17:52 -04:00
parent 347a43f4fe
commit c1ae879d90

View File

@@ -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;
}