mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
small passed.cron bug fix
This commit is contained in:
parent
0f013d2ef3
commit
2e3e99e366
2 changed files with 2 additions and 9 deletions
|
|
@ -117,7 +117,7 @@ ready(function(model) {
|
|||
tour.start();
|
||||
model.on('set', '_user.tasks.*.completed', function(i, completed, previous, isLocal, passed) {
|
||||
var direction, from, fromIds, task, to, toIds, _ref3, _ref4;
|
||||
if (passed.cron != null) {
|
||||
if ((passed != null) && passed.cron) {
|
||||
return;
|
||||
}
|
||||
direction = function() {
|
||||
|
|
@ -299,12 +299,6 @@ ready(function(model) {
|
|||
model.set('_user.lastCron', today);
|
||||
_results = [];
|
||||
for (n = _k = 1; 1 <= daysPassed ? _k <= daysPassed : _k >= daysPassed; n = 1 <= daysPassed ? ++_k : --_k) {
|
||||
console.log({
|
||||
today: today,
|
||||
lastCron: lastCron,
|
||||
daysPassed: daysPassed,
|
||||
n: n
|
||||
}, "[debug] Cron (" + today + ", " + n + ")");
|
||||
_results.push(scoring.tally(model));
|
||||
}
|
||||
return _results;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ ready (model) ->
|
|||
tour.start()
|
||||
|
||||
model.on 'set', '_user.tasks.*.completed', (i, completed, previous, isLocal, passed) ->
|
||||
return if passed.cron? # Don't do this stuff on cron
|
||||
return if passed? && passed.cron # Don't do this stuff on cron
|
||||
direction = () ->
|
||||
return 'up' if completed==true and previous == false
|
||||
return 'down' if completed==false and previous == true
|
||||
|
|
@ -244,7 +244,6 @@ ready (model) ->
|
|||
if daysPassed > 0
|
||||
model.set('_user.lastCron', today) # reset cron
|
||||
for n in [1..daysPassed]
|
||||
console.log {today: today, lastCron: lastCron, daysPassed: daysPassed, n:n}, "[debug] Cron (#{today}, #{n})"
|
||||
scoring.tally(model)
|
||||
poormanscron() # Run once on refresh
|
||||
setInterval (-> # Then run once every hour
|
||||
|
|
|
|||
Loading…
Reference in a new issue