From 0df09f7f356811a4d2375bf9c963b6bed2ef9c94 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Fri, 21 Mar 2014 21:11:51 -0700 Subject: [PATCH] Fixed an ever-reloading bug. --- app/views/play/ladder/ladder_tab.coffee | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/play/ladder/ladder_tab.coffee b/app/views/play/ladder/ladder_tab.coffee index 2abd0cabf..7b15e4c94 100644 --- a/app/views/play/ladder/ladder_tab.coffee +++ b/app/views/play/ladder/ladder_tab.coffee @@ -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) @@ -32,6 +32,13 @@ module.exports = class LadderTabView extends CocoView @leaderboards = {} @refreshLadder() @checkFriends() + + onConnectFacebook: -> + @connecting = true + FB.login() + + onConnectedWithFacebook: -> + location.reload() if @connecting checkFriends: -> @loadingFriends = true