groups: balance deduction cleanup

This commit is contained in:
Tyler Renelle
2013-06-05 14:14:00 -04:00
parent fcf02d33d9
commit a7c8c843cd
+2 -4
View File
@@ -25,15 +25,13 @@ module.exports.app = (appExports, model, app) ->
return model.add 'groups', newGroup, ->location.reload()
# guilds - 4G
balance = user.get('balance')
unless balance >= 1
unless user.get('balance') >= 1
return $('#more-gems-modal').modal 'show'
if confirm "Create Guild for 4 Gems?"
newGroup.privacy = (model.get("_new.group.privacy") || 'public') if type is 'guild'
newGroup.balance = 1 # they spent $ to open the guild, it goes into their guild bank
model.add 'groups', newGroup, ->
user.set 'balance', (balance - 1)
location.reload()
user.incr 'balance', -1, ->location.reload()
appExports.toggleGroupEdit = (e, el) ->
path = "_editing.groups.#{$(el).attr('data-gid')}"