mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Fixed an ever-reloading bug.
This commit is contained in:
parent
2cdfbf1c48
commit
0df09f7f35
1 changed files with 9 additions and 2 deletions
|
@ -21,10 +21,10 @@ module.exports = class LadderTabView extends CocoView
|
|||
startsLoading: true
|
||||
|
||||
events:
|
||||
'click .connect-facebook': -> FB.login()
|
||||
'click .connect-facebook': 'onConnectFacebook'
|
||||
|
||||
subscriptions:
|
||||
'facebook-logged-in': -> location.reload()
|
||||
'facebook-logged-in': 'onConnectedWithFacebook'
|
||||
|
||||
constructor: (options, @level, @sessions) ->
|
||||
super(options)
|
||||
|
@ -33,6 +33,13 @@ module.exports = class LadderTabView extends CocoView
|
|||
@refreshLadder()
|
||||
@checkFriends()
|
||||
|
||||
onConnectFacebook: ->
|
||||
@connecting = true
|
||||
FB.login()
|
||||
|
||||
onConnectedWithFacebook: ->
|
||||
location.reload() if @connecting
|
||||
|
||||
checkFriends: ->
|
||||
@loadingFriends = true
|
||||
FB.getLoginStatus (response) =>
|
||||
|
|
Loading…
Reference in a new issue