mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-29 18:27:14 +00:00
notifications tweak and history fix
This commit is contained in:
parent
1fadb7955a
commit
50c5069224
2 changed files with 3 additions and 3 deletions
|
|
@ -178,7 +178,7 @@ setupGrowlNotifications = (model) ->
|
|||
# unless silent
|
||||
num = captures - args
|
||||
rounded = Math.abs(num.toFixed(1))
|
||||
if num < 0 and num > -100 # TODO fix hackey negative notification supress
|
||||
if num < 0 and num > -50 # TODO fix hackey negative notification supress
|
||||
statsNotification "<i class='icon-star'></i> - #{rounded} XP", 'xp'
|
||||
else if num > 0
|
||||
statsNotification "<i class='icon-star'></i> + #{rounded} XP", 'xp'
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ cron = (model) ->
|
|||
batch.set "tasks.#{taskObj.id}.value", newValue
|
||||
|
||||
taskObj.history ?= []
|
||||
taskObj.history.push { date: +new Date, value: value }
|
||||
taskObj.history.push { date: +new Date, value: newValue || taskObj.value }
|
||||
batch.set "tasks.#{taskObj.id}.history", taskObj.history
|
||||
batch.set "tasks.#{taskObj.id}.completed", false
|
||||
else
|
||||
|
|
@ -229,7 +229,7 @@ cron = (model) ->
|
|||
todoTally += absVal
|
||||
else if type is 'habit' # slowly reset 'onlies' value to 0
|
||||
if taskObj.up==false or taskObj.down==false
|
||||
if Math.abs(taskObj.value) < 0.02
|
||||
if Math.abs(taskObj.value) < 0.1
|
||||
batch.set "tasks.#{taskObj.id}.value", 0
|
||||
else
|
||||
batch.set "tasks.#{taskObj.id}.value", taskObj.value / 2
|
||||
|
|
|
|||
Loading…
Reference in a new issue