Merge branch 'develop' into release

This commit is contained in:
Sabe Jones
2021-10-28 13:55:11 -05:00
71 changed files with 2295 additions and 1729 deletions

View File

@@ -525,21 +525,3 @@ schema.methods.getSecretData = function getSecretData () {
return user.secret;
};
// Enroll users in the Drop Cap A/B Test
schema.methods.enrollInDropCapABTest = function enrollInDropCapABTest (xClientHeader) {
// Only target users that use web for cron and aren't subscribed.
// Those using mobile aren't excluded as they may use it later
const isWeb = xClientHeader === 'habitica-web';
if (isWeb && !this._ABtests.dropCapNotif && !this.isSubscribed()) {
const testGroup = Math.random();
// Enroll 100% of users, splitting them 50/50
if (testGroup <= 0.50) {
this._ABtests.dropCapNotif = 'drop-cap-notif-enabled';
} else {
this._ABtests.dropCapNotif = 'drop-cap-notif-disabled';
}
this.markModified('_ABtests');
}
};