mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-16 00:42:18 +00:00
Merge branch 'release' into develop
This commit is contained in:
commit
9706a9c8be
3 changed files with 16 additions and 8 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "habitica",
|
||||
"version": "4.140.5",
|
||||
"version": "4.140.6",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "habitica",
|
||||
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
|
||||
"version": "4.140.5",
|
||||
"version": "4.140.6",
|
||||
"main": "./website/server/index.js",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.9.0",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import reduce from 'lodash/reduce';
|
|||
import filter from 'lodash/filter';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
import size from 'lodash/size';
|
||||
import moment from 'moment';
|
||||
import content from '../content/index';
|
||||
import i18n from '../i18n';
|
||||
import { daysSince } from '../cron';
|
||||
|
|
@ -146,7 +145,11 @@ export default function randomDrop (user, options, req = {}, analytics) {
|
|||
}, req.language);
|
||||
}
|
||||
|
||||
if (analytics && moment().diff(user.auth.timestamps.created, 'days') < 7) {
|
||||
user._tmp.drop = drop;
|
||||
user.items.lastDrop.date = Number(new Date());
|
||||
user.items.lastDrop.count += 1;
|
||||
|
||||
if (analytics) {
|
||||
analytics.track('dropped item', {
|
||||
uuid: user._id,
|
||||
itemKey: drop.key,
|
||||
|
|
@ -154,10 +157,15 @@ export default function randomDrop (user, options, req = {}, analytics) {
|
|||
category: 'behavior',
|
||||
headers: req.headers,
|
||||
});
|
||||
}
|
||||
|
||||
user._tmp.drop = drop;
|
||||
user.items.lastDrop.date = Number(new Date());
|
||||
user.items.lastDrop.count += 1;
|
||||
if (user.items.lastDrop.count === maxDropCount) {
|
||||
analytics.track('drop cap reached', {
|
||||
uuid: user._id,
|
||||
dropCap: maxDropCount,
|
||||
category: 'behavior',
|
||||
headers: req.headers,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue