mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-18 01:42:20 +00:00
groups: some ridiculous workarounds on the model.push/unshift bug
This commit is contained in:
parent
d13db1623f
commit
9ec6455f2a
2 changed files with 8 additions and 2 deletions
|
|
@ -128,6 +128,11 @@ module.exports.app = (appExports, model, app) ->
|
|||
return unless /\S/.test text
|
||||
|
||||
group = e.at()
|
||||
|
||||
# get rid of duplicate member ids - this is a weird place to put it, but works for now
|
||||
members = group.get('members'); uniqMembers = _.uniq(members)
|
||||
group.set('members', uniqMembers) if !_.isEqual(uniqMembers, members)
|
||||
|
||||
chat = group.at('chat')
|
||||
model.set('_chatMessage', '')
|
||||
|
||||
|
|
|
|||
|
|
@ -110,14 +110,15 @@ module.exports.fixCorruptUser = (model) ->
|
|||
user.del("tasks.#{key}")
|
||||
delete tasks[key]
|
||||
true
|
||||
|
||||
resetDom = false
|
||||
batchTxn model, (uObj, paths, batch) ->
|
||||
|
||||
## fix https://github.com/lefnire/habitrpg/issues/1086
|
||||
uniqPets = _.uniq(uObj.items.pets)
|
||||
batch.set('items.pets', uniqPets) if !_.isEqual(uniqPets, uObj.items.pets)
|
||||
|
||||
uniqInvites = _.uniq(uObj.invitations?.guilds)
|
||||
batch.set('invitations.guilds', uniqInvites) if !_.isEqual(uniqInvites, uObj.invitations?.guilds)
|
||||
|
||||
## Task List Cleanup
|
||||
['habit','daily','todo','reward'].forEach (type) ->
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue