mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
allow manually unlocking party system
This commit is contained in:
parent
14babdbf24
commit
545e5fc2a4
2 changed files with 12 additions and 4 deletions
|
|
@ -71,8 +71,7 @@ module.exports.partySubscribe = partySubscribe = (page, model, params, next, cb)
|
|||
module.exports.app = (appExports, model) ->
|
||||
user = model.at('_user')
|
||||
|
||||
user.on 'set', 'flags.partyEnabled', (captures, args) ->
|
||||
return unless captures == true
|
||||
unlockPartiesNotification = ->
|
||||
$('.main-avatar').popover('destroy') #remove previous popovers
|
||||
html = """
|
||||
<div class='party-system-popover'>
|
||||
|
|
@ -89,6 +88,14 @@ module.exports.app = (appExports, model) ->
|
|||
content: html
|
||||
$('.main-avatar').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
|
||||
|
|
|
|||
|
|
@ -18,8 +18,9 @@
|
|||
</div>
|
||||
|
||||
<hr/>
|
||||
<h4>Toggle Header</h4>
|
||||
<button x-bind="click:toggleHeader">{#if _user.preferences.hideHeader}Show{else}Hide{/}</button>
|
||||
<h4>Misc</h4>
|
||||
<button x-bind="click:toggleHeader">{#if _user.preferences.hideHeader}Show Header{else}Hide Header{/}</button>
|
||||
{#unless _user.flags.partyEnabled} <button x-bind="click:manuallyUnlockParties" data-dismiss='modal' rel=tooltip title="Parties are unlocked automatically for usability reasons, but you can override that here.">Enable Parties</button>{/}
|
||||
|
||||
{{#if _user.auth.local}}
|
||||
<hr/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue