mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-11 14:39:37 +00:00
ensure task.priority is number for apiv1
This commit is contained in:
parent
d3e3775ecd
commit
aef68fdc82
2 changed files with 4 additions and 0 deletions
3
dist/habitrpg-shared.js
vendored
3
dist/habitrpg-shared.js
vendored
|
|
@ -10788,6 +10788,9 @@ var process=require("__browserify_process");(function() {
|
|||
if (task.value == null) {
|
||||
task.value = task.type === 'reward' ? 10 : 0;
|
||||
}
|
||||
if (!_.isNumber(task.priority)) {
|
||||
task.priority = 1;
|
||||
}
|
||||
return task;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ api.taskDefaults = (task) ->
|
|||
_.defaults(task, {streak:0, repeat: {su:1,m:1,t:1,w:1,th:1,f:1,s:1}}) if task.type is 'daily'
|
||||
task._id = task.id # may need this for TaskSchema if we go back to using it, see http://goo.gl/a5irq4
|
||||
task.value ?= if task.type is 'reward' then 10 else 0
|
||||
task.priority = 1 unless _.isNumber(task.priority) # hotfix for apiv1. once we're off apiv1, we can remove this
|
||||
task
|
||||
|
||||
api.percent = (x,y) ->
|
||||
|
|
|
|||
Loading…
Reference in a new issue