Incentives, Batch 2 (#8435)

* feat(content): Incentives batch 2 gear

* feat(incentives): incentives 55-100

* chore(migration): hand out missed incentive

* refactor(constant): export MAX_INCENTIVES

* fix(incentives): correct const import
and say "Royal Purple Potion" not "Royal Purple"
This commit is contained in:
Sabe Jones
2017-01-20 20:36:38 -06:00
committed by GitHub
parent 9cf2408988
commit 37a71924fe
17 changed files with 234 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ import nconf from 'nconf';
const CRON_SAFE_MODE = nconf.get('CRON_SAFE_MODE') === 'true';
const CRON_SEMI_SAFE_MODE = nconf.get('CRON_SEMI_SAFE_MODE') === 'true';
const MAX_INCENTIVES = common.constants.MAX_INCENTIVES;
const shouldDo = common.shouldDo;
const scoreTask = common.ops.scoreTask;
const i18n = common.i18n;
@@ -129,7 +130,7 @@ function trackCronAnalytics (analytics, user, _progress, options) {
}
function awardLoginIncentives (user) {
if (user.loginIncentives > 50) return;
if (user.loginIncentives > MAX_INCENTIVES) return;
// A/B test 2016-12-21: Should we deliver notifications for upcoming incentives on days when users don't receive rewards?
if (!loginIncentives[user.loginIncentives].rewardKey && user._ABtests && user._ABtests.checkInModals === '20161221_noCheckInPreviews') return;