mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-22 05:38:46 +00:00
dailies not resetting on cron
This commit is contained in:
parent
68f5cd1184
commit
8baa4cd8db
1 changed files with 6 additions and 6 deletions
|
|
@ -151,11 +151,6 @@ score = (taskId, direction, times, batch, cron) ->
|
|||
calculateDelta()
|
||||
if cron? # cron
|
||||
subtractPoints()
|
||||
taskObj.history ?= []
|
||||
taskObj.history.push { date: +new Date, value: value }
|
||||
taskObj.completed = false
|
||||
batch.set "#{taskPath}.history", taskObj.history
|
||||
batch.set "#{taskPath}.completed", false
|
||||
else
|
||||
addPoints() # obviously for delta>0, but also a trick to undo accidental checkboxes
|
||||
|
||||
|
|
@ -225,7 +220,12 @@ cron = (resetDom_cb) ->
|
|||
daysFailed++
|
||||
score id, 'down', daysFailed, batch, true
|
||||
|
||||
if type == 'todo'
|
||||
if type == 'daily'
|
||||
taskObj.history ?= []
|
||||
taskObj.history.push { date: +new Date, value: value }
|
||||
batch.set "tasks.#{taskObj.id}.history", taskObj.history
|
||||
batch.set "tasks.#{taskObj.id}.completed", false
|
||||
else
|
||||
value = obj.tasks[taskObj.id].value #get updated value
|
||||
absVal = if (completed) then Math.abs(value) else value
|
||||
todoTally += absVal
|
||||
|
|
|
|||
Loading…
Reference in a new issue