From a7c8c843cde2de5e41659b6efdbb24392f75b82b Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 5 Jun 2013 14:14:00 -0400 Subject: [PATCH] groups: balance deduction cleanup --- src/app/groups.coffee | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/groups.coffee b/src/app/groups.coffee index 13d30ce87f..ef1f363e24 100644 --- a/src/app/groups.coffee +++ b/src/app/groups.coffee @@ -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')}"