mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
duplicates bug: _.uniq was expected list to be sorted, they're not sorted
This commit is contained in:
parent
673ed86c7e
commit
c4099f8519
1 changed files with 2 additions and 5 deletions
|
|
@ -11,7 +11,7 @@ scoring = require './scoring'
|
|||
schema = require './schema'
|
||||
helpers = require './helpers'
|
||||
helpers.viewHelpers view
|
||||
_ = require('underscore')._
|
||||
_ = require('underscore')
|
||||
|
||||
|
||||
# ========== ROUTES ==========
|
||||
|
|
@ -61,10 +61,7 @@ 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) ->
|
||||
orig = user.get(path)
|
||||
unique = _.uniq(orig, true)
|
||||
if orig.length != unique.length
|
||||
user.set path, unique
|
||||
user.set path, _.uniq(user.get(path))
|
||||
|
||||
# Setup Model Functions
|
||||
model.fn '_user._tnl', '_user.stats.lvl', (lvl) ->
|
||||
|
|
|
|||
Loading…
Reference in a new issue