Revert "remove duplicates, also remove grey / empty tasks"

This reverts commit 89dcc25364.
This commit is contained in:
Tyler Renelle 2013-01-15 21:38:00 -05:00
parent d03b4b5477
commit f1bfe7ae69

View file

@ -59,15 +59,9 @@ get '/:uid?', (page, model, {uid}, next) ->
model.refList "_completedList", "_user.tasks", "_user.completedIds"
model.refList "_rewardList", "_user.tasks", "_user.rewardIds"
# FIXME temporary hack to remove duplicates and empty (grey) tasks. Need to figure out why they're being produced
taskIds = _.keys model.get('_user.tasks')
# FIXME temporary hack to remove duplicates. Need to figure out why they're being produced
_.each ['habitIds','dailyIds','todoIds','rewardIds'], (path) ->
original = user.get(path)
unique = _.uniq original #remove duplicates
preened = _.reject unique, (obj, key) -> #remove empty grey tasks
!_.contains(taskIds, key)
if original.length != preened.length # issues were indeed found
user.set path, _.uniq(user.get(path))
user.set path, _.uniq(user.get(path))
# Setup Model Functions
model.fn '_user._tnl', '_user.stats.lvl', (lvl) ->