mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
* Add balanceGemAmount property * Add check for balanceGemAmount property * Fix balanceGemAmount to be 4 times balance
This commit is contained in:
@@ -303,6 +303,7 @@ describe('analyticsService', () => {
|
|||||||
contributorLevel: 1,
|
contributorLevel: 1,
|
||||||
subscription: 'foo-plan',
|
subscription: 'foo-plan',
|
||||||
balance: 12,
|
balance: 12,
|
||||||
|
balanceGemAmount: 48,
|
||||||
loginIncentives: 1,
|
loginIncentives: 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ describe('Analytics Service', function () {
|
|||||||
rewards: 1
|
rewards: 1
|
||||||
};
|
};
|
||||||
expectedProperties.balance = 12;
|
expectedProperties.balance = 12;
|
||||||
|
expectedProperties.balanceGemAmount = 48;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
user._id = 'unique-user-id';
|
user._id = 'unique-user-id';
|
||||||
@@ -243,7 +244,8 @@ describe('Analytics Service', function () {
|
|||||||
habits: 1,
|
habits: 1,
|
||||||
rewards: 1
|
rewards: 1
|
||||||
},
|
},
|
||||||
balance: 12
|
balance: 12,
|
||||||
|
balanceGemAmount: 48
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
|
|||||||
@@ -129,6 +129,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
properties.balance = user.balance;
|
properties.balance = user.balance;
|
||||||
|
properties.balanceGemAmount = properties.balance * 4;
|
||||||
|
|
||||||
properties.tutorialComplete = user.flags && user.flags.tour && user.flags.tour.intro === -2;
|
properties.tutorialComplete = user.flags && user.flags.tour && user.flags.tour.intro === -2;
|
||||||
if (user.habits && user.dailys && user.todos && user.rewards) {
|
if (user.habits && user.dailys && user.todos && user.rewards) {
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ let _formatUserData = (user) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
properties.balance = user.balance;
|
properties.balance = user.balance;
|
||||||
|
properties.balanceGemAmount = properties.balance * 4;
|
||||||
|
|
||||||
properties.tutorialComplete = user.flags && user.flags.tour && user.flags.tour.intro === -2;
|
properties.tutorialComplete = user.flags && user.flags.tour && user.flags.tour.intro === -2;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user