groups: some ridiculous workarounds on the model.push/unshift bug
This commit is contained in:
@@ -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', '')
|
||||
|
||||
|
||||
+3
-2
@@ -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) ->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user