mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-17 09:22:19 +00:00
groups: subscriptions setup as callback after public members
information fetched. otherwise we hit client/server snapshots different, and we get the field permissions error
This commit is contained in:
parent
9ec6455f2a
commit
985b7676d8
1 changed files with 9 additions and 9 deletions
|
|
@ -75,15 +75,15 @@ setupSubscriptions = (page, model, params, next, cb) ->
|
|||
model.set "_members", _.object(_.pluck(mObj,'id'), mObj)
|
||||
model.set "_membersArray", mObj
|
||||
|
||||
# Note - selfQ *must* come after membersQ in subscribe, otherwise _user will only get the fields restricted by party-members in store.coffee. Strang bug, but easy to get around
|
||||
descriptors = [selfQ]; paths = ['_user']
|
||||
if groupsInfo.partyId
|
||||
descriptors.unshift model.query('groups').withIds(groupsInfo.partyId)
|
||||
paths.unshift '_party'
|
||||
unless _.isEmpty(groupsInfo.guildIds)
|
||||
descriptors.unshift model.query('groups').withIds(groupsInfo.guildIds)
|
||||
paths.unshift '_guilds'
|
||||
finished descriptors, paths
|
||||
# Note - selfQ *must* come after membersQ in subscribe, otherwise _user will only get the fields restricted by party-members in store.coffee. Strang bug, but easy to get around
|
||||
descriptors = [selfQ]; paths = ['_user']
|
||||
if groupsInfo.partyId
|
||||
descriptors.unshift model.query('groups').withIds(groupsInfo.partyId)
|
||||
paths.unshift '_party'
|
||||
unless _.isEmpty(groupsInfo.guildIds)
|
||||
descriptors.unshift model.query('groups').withIds(groupsInfo.guildIds)
|
||||
paths.unshift '_guilds'
|
||||
finished descriptors, paths
|
||||
|
||||
|
||||
# ========== ROUTES ==========
|
||||
|
|
|
|||
Loading…
Reference in a new issue