mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-17 09:22:19 +00:00
only set unique idlists if there were duplicates to begin with
This commit is contained in:
parent
c828593cac
commit
c20552b99f
1 changed files with 5 additions and 2 deletions
|
|
@ -59,8 +59,11 @@ get '/:uid?', (page, model, {uid}, next) ->
|
|||
|
||||
# FIXME temporary hack to remove duplicates. Need to figure out why they're being produced
|
||||
_.each ['habitIds','dailyIds','todoIds','rewardIds'], (path) ->
|
||||
user.set path, _.uniq(user.get(path), true)
|
||||
|
||||
orig = user.get(path)
|
||||
unique = _.uniq(orig, true)
|
||||
if orig.length != unique.length
|
||||
user.set path, unique
|
||||
|
||||
# Setup Model Functions
|
||||
model.fn '_user._tnl', '_user.stats.lvl', (lvl) ->
|
||||
# see https://github.com/lefnire/habitrpg/issues/4
|
||||
|
|
|
|||
Loading…
Reference in a new issue