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:
Tyler Renelle 2013-06-03 20:52:56 -04:00
parent 9ec6455f2a
commit 985b7676d8

View file

@ -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 ==========