Skip locked Promotions (#132)

This commit is contained in:
CNOCM
2024-08-18 20:37:56 +08:00
committed by GitHub
parent 2b4cd505c0
commit 755237caa1
2 changed files with 3 additions and 3 deletions

View File

@@ -158,7 +158,7 @@ export default class BrowserFunc {
if (data.morePromotions?.length) { if (data.morePromotions?.length) {
data.morePromotions.forEach(x => { data.morePromotions.forEach(x => {
// Only count points from supported activities // Only count points from supported activities
if (['quiz', 'urlreward'].includes(x.promotionType)) { if (['quiz', 'urlreward'].includes(x.promotionType) && !x.attributes.is_unlocked) {
totalEarnablePoints += (x.pointProgressMax - x.pointProgress) totalEarnablePoints += (x.pointProgressMax - x.pointProgress)
} }
}) })

View File

@@ -87,7 +87,7 @@ export class Workers {
morePromotions.push(data.promotionalItem as unknown as MorePromotion) morePromotions.push(data.promotionalItem as unknown as MorePromotion)
} }
const activitiesUncompleted = morePromotions?.filter(x => !x.complete && x.pointProgressMax > 0) ?? [] const activitiesUncompleted = morePromotions?.filter(x => !x.complete && x.pointProgressMax > 0 && !x.attributes.is_unlocked) ?? [];
if (!activitiesUncompleted.length) { if (!activitiesUncompleted.length) {
this.bot.log('MORE-PROMOTIONS', 'All "More Promotion" items have already been completed') this.bot.log('MORE-PROMOTIONS', 'All "More Promotion" items have already been completed')