mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Update clan analytics
This commit is contained in:
parent
f80a73ae9b
commit
38cdb3d057
2 changed files with 9 additions and 3 deletions
|
@ -178,7 +178,10 @@ module.exports = class ClanDetailsView extends RootView
|
|||
onJoinClan: (e) ->
|
||||
return @openModalView(new AuthModal()) if me.isAnonymous()
|
||||
return unless @clan.loaded
|
||||
return @openModalView new SubscribeModal() if @clan.get('type') is 'private' and not me.isPremium()
|
||||
if @clan.get('type') is 'private' and not me.isPremium()
|
||||
@openModalView new SubscribeModal()
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'join clan'
|
||||
return
|
||||
options =
|
||||
url: "/db/clan/#{@clanID}/join"
|
||||
method: 'PUT'
|
||||
|
|
|
@ -91,9 +91,12 @@ module.exports = class MainAdminView extends RootView
|
|||
)
|
||||
|
||||
onClickCreateClan: (e) ->
|
||||
return @openModalView(new AuthModal()) if me.isAnonymous()
|
||||
return @openModalView new AuthModal() if me.isAnonymous()
|
||||
clanType = if $('.private-clan-checkbox').prop('checked') then 'private' else 'public'
|
||||
return @openModalView new SubscribeModal() if clanType is 'private' and not me.isPremium()
|
||||
if clanType is 'private' and not me.isPremium()
|
||||
@openModalView new SubscribeModal()
|
||||
window.tracker?.trackEvent 'Show subscription modal', category: 'Subscription', label: 'create clan'
|
||||
return
|
||||
if name = $('.create-clan-name').val()
|
||||
clan = new Clan()
|
||||
clan.set 'type', clanType
|
||||
|
|
Loading…
Reference in a new issue