diff --git a/src/app/party.coffee b/src/app/party.coffee index 7fdef59ffc..47fb07fe6c 100644 --- a/src/app/party.coffee +++ b/src/app/party.coffee @@ -71,38 +71,31 @@ module.exports.partySubscribe = partySubscribe = (page, model, params, next, cb) module.exports.app = (appExports, model) -> user = model.at('_user') - unlockPartiesNotification = -> - $('.main-herobox').popover('destroy') #remove previous popovers + user.on 'set', 'flags.partyEnabled', (captures, args) -> + return if (captures != true) or user.get('party.current') + $('.user-menu').popover('destroy') #remove previous popovers html = """
- Congratulations, you have unlocked the Party System! You can now group with your friends by adding their User Ids. - [Close] + Be social, join a party and play Habit with your friends! You'll be better at your habits with accountability partners. LFG anyone? + [Close]
""" - $('.main-herobox').popover - title: "Party System Unlocked" + $('.user-menu').popover + title: "Party System" placement: 'bottom' trigger: 'manual' html: true content: html - $('.main-herobox').popover 'show' + $('.user-menu').popover 'show' - appExports.manuallyUnlockParties = -> - $("#settings-modal").modal("hide") - user.set('flags.partyEnabled', true) - unlockPartiesNotification() - - user.on 'set', 'flags.partyEnabled', (captures, args) -> - unlockPartiesNotification() if captures == true - - #TODO implement this when we have unsubscribe working properly model.on 'set', '_user.party.invitation', (after, before) -> if !before? and after? # they just got invited - # if they haven't unlocked parties yet, unlock it for them - user.set('flags.partyEnabled',true) unless user.get('flags.partyEnabled') - window.setTimeout (-> window.location.reload true), 1000 - #partySubscribe(null, model, null, null, null) + partyQ = model.query('parties').withId(after) + partyQ.fetch (err, party) -> + return next(err) if err + model.ref '_party', party + browser.resetDom(model) appExports.partyCreate = -> newParty = model.get("_newParty") diff --git a/views/app/settings.html b/views/app/settings.html index 52ec58dcb9..355be6b493 100644 --- a/views/app/settings.html +++ b/views/app/settings.html @@ -20,7 +20,6 @@

Misc

- {#unless _user.flags.partyEnabled} {/} {{#if _user.auth.local}}
@@ -140,10 +139,10 @@ {{else}}