feat(analytics): initial Habitica-owned solution
This commit is contained in:
committed by
Kalista Payne
parent
746fcfff49
commit
e6ffd69148
@@ -1,12 +1,11 @@
|
||||
import each from 'lodash/each';
|
||||
import pick from 'lodash/pick';
|
||||
import i18n from '../i18n';
|
||||
import {
|
||||
NotAuthorized,
|
||||
} from '../libs/errors';
|
||||
import updateUserBalance from './updateUserBalance';
|
||||
|
||||
export default async function reroll (user, tasks = [], req = {}, analytics) {
|
||||
export default async function reroll (user, tasks = [], req = {}) {
|
||||
if (user.balance < 1) {
|
||||
throw new NotAuthorized(i18n.t('notEnoughGems', req.language));
|
||||
}
|
||||
@@ -22,17 +21,6 @@ export default async function reroll (user, tasks = [], req = {}, analytics) {
|
||||
}
|
||||
});
|
||||
|
||||
if (analytics) {
|
||||
analytics.track('Fortify Potion', {
|
||||
user: pick(user, ['preferences', 'registeredThrough']),
|
||||
uuid: user._id,
|
||||
currency: 'Gems',
|
||||
gemCost: 4,
|
||||
category: 'behavior',
|
||||
headers: req.headers,
|
||||
});
|
||||
}
|
||||
|
||||
return [
|
||||
{ user, tasks },
|
||||
i18n.t('fortifyComplete'),
|
||||
|
||||
Reference in New Issue
Block a user