mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 04:29:40 +00:00
5482a83 add minHistLen as a parameter to preenUserHistory (with a
default value of 7)
This commit is contained in:
parent
761887da18
commit
317f1a9319
2 changed files with 5 additions and 5 deletions
7
dist/habitrpg-shared.js
vendored
7
dist/habitrpg-shared.js
vendored
|
|
@ -8721,9 +8721,10 @@ if(typeof module != 'undefined' && module.exports){
|
|||
return newHistory;
|
||||
};
|
||||
|
||||
obj.preenUserHistory = function(user) {
|
||||
var minHistLen;
|
||||
minHistLen = 7;
|
||||
obj.preenUserHistory = function(user, minHistLen) {
|
||||
if (minHistLen == null) {
|
||||
minHistLen = 7;
|
||||
}
|
||||
_.each(user.habits.concat(user.dailys), function(task) {
|
||||
var _ref1;
|
||||
if (((_ref1 = task.history) != null ? _ref1.length : void 0) > minHistLen) {
|
||||
|
|
|
|||
|
|
@ -476,8 +476,7 @@ preenHistory = (history) ->
|
|||
newHistory
|
||||
|
||||
# Registered users with some history
|
||||
obj.preenUserHistory = (user) ->
|
||||
minHistLen = 7
|
||||
obj.preenUserHistory = (user, minHistLen = 7) ->
|
||||
_.each user.habits.concat(user.dailys), (task) ->
|
||||
task.history = preenHistory(task.history) if task.history?.length > minHistLen
|
||||
true
|
||||
|
|
|
|||
Loading…
Reference in a new issue