mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
added balance to analytics (#8086)
* added balance to analytics * removed if check
This commit is contained in:
committed by
Blade Barringer
parent
3c7f71d214
commit
ed880a665a
@@ -277,6 +277,7 @@ describe('analyticsService', () => {
|
||||
dailys: [{_id: 'daily'}],
|
||||
todos: [{_id: 'todo'}],
|
||||
rewards: [{_id: 'reward'}],
|
||||
balance: 12,
|
||||
};
|
||||
|
||||
data.user = user;
|
||||
@@ -300,6 +301,7 @@ describe('analyticsService', () => {
|
||||
},
|
||||
contributorLevel: 1,
|
||||
subscription: 'foo-plan',
|
||||
balance: 12,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -193,6 +193,7 @@ describe('Analytics Service', function () {
|
||||
todos: 1,
|
||||
rewards: 1
|
||||
};
|
||||
expectedProperties.balance = 12;
|
||||
|
||||
beforeEach(function() {
|
||||
user._id = 'unique-user-id';
|
||||
@@ -207,6 +208,7 @@ describe('Analytics Service', function () {
|
||||
user.dailys = [{_id: 'daily'}];
|
||||
user.todos = [{_id: 'todo'}];
|
||||
user.rewards = [{_id: 'reward'}];
|
||||
user.balance = 12;
|
||||
|
||||
analytics.updateUser(properties);
|
||||
clock.tick();
|
||||
@@ -240,7 +242,8 @@ describe('Analytics Service', function () {
|
||||
dailys: 1,
|
||||
habits: 1,
|
||||
rewards: 1
|
||||
}
|
||||
},
|
||||
balance: 12
|
||||
};
|
||||
|
||||
beforeEach(function() {
|
||||
@@ -258,6 +261,7 @@ describe('Analytics Service', function () {
|
||||
user.dailys = [{_id: 'daily'}];
|
||||
user.todos = [{_id: 'todo'}];
|
||||
user.rewards = [{_id: 'reward'}];
|
||||
user.balance = 12;
|
||||
|
||||
analytics.updateUser();
|
||||
clock.tick();
|
||||
|
||||
@@ -127,6 +127,9 @@
|
||||
properties.Level = user.stats.lvl;
|
||||
properties.Mana = Math.floor(user.stats.mp);
|
||||
}
|
||||
|
||||
properties.balance = user.balance;
|
||||
|
||||
properties.tutorialComplete = user.flags && user.flags.tour && user.flags.tour.intro === -2;
|
||||
if (user.habits && user.dailys && user.todos && user.rewards) {
|
||||
properties["Number Of Tasks"] = {
|
||||
|
||||
@@ -66,6 +66,8 @@ let _formatUserData = (user) => {
|
||||
properties.Mana = Math.floor(user.stats.mp);
|
||||
}
|
||||
|
||||
properties.balance = user.balance;
|
||||
|
||||
properties.tutorialComplete = user.flags && user.flags.tour && user.flags.tour.intro === -2;
|
||||
|
||||
if (user.habits && user.dailys && user.todos && user.rewards) {
|
||||
|
||||
Reference in New Issue
Block a user