From 985b7676d8c0f8c887795bf6e38351d64f1e9d32 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 3 Jun 2013 20:52:56 -0400 Subject: [PATCH] groups: subscriptions setup as callback after public members information fetched. otherwise we hit client/server snapshots different, and we get the field permissions error --- src/app/index.coffee | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/index.coffee b/src/app/index.coffee index ea0d31781a..069eef103b 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -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 ==========