mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 12:48:52 +00:00
Updating the task list cleanup to not restore the completedIds list.
Fixing the mocha test to not check for the completedIds.
This commit is contained in:
parent
b697e7bdf1
commit
61b848bf4f
2 changed files with 1 additions and 5 deletions
|
|
@ -59,15 +59,12 @@ get '/', (page, model, next) ->
|
|||
## Task List Cleanup
|
||||
# FIXME temporary hack to fix lists (Need to figure out why these are happening)
|
||||
# FIXME consolidate these all under user.listIds so we can set them en-masse
|
||||
_.each ['habit','daily','todo', 'completed', 'reward'], (type) ->
|
||||
_.each ['habit','daily','todo','reward'], (type) ->
|
||||
path = "#{type}Ids"
|
||||
|
||||
# 1. remove duplicates
|
||||
# 2. restore missing zombie tasks back into list
|
||||
where = {type:type}
|
||||
if type in ['completed', 'todo']
|
||||
where.type = 'todo'
|
||||
where.completed = if type == 'completed' then true else false
|
||||
taskIds = _.pluck( _.where(userObj.tasks, where), 'id')
|
||||
union = _.union userObj[path], taskIds
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ describe 'User', ->
|
|||
expect(_.size(user.habitIds)).to.eql 3
|
||||
expect(_.size(user.dailyIds)).to.eql 3
|
||||
expect(_.size(user.todoIds)).to.eql 1
|
||||
expect(_.size(user.completedIds)).to.eql 0
|
||||
expect(_.size(user.rewardIds)).to.eql 2
|
||||
|
||||
##### Habits #####
|
||||
|
|
|
|||
Loading…
Reference in a new issue