codecombat/codecombat — pull request #1196 by thgil (2014-06-20 01:48:38+00:00)
Title: Facebook friends patch

This commit fixes a FB warning and increases the FB friends session loading time by a bunch.

```
FB.getLoginStatus() called before calling FB.init().
```
I believe this warning was being thrown because `@checkFriends()` was being called in the constructor of the ladder_tab view before `FB.init()` had a chance. I don't think this is needed here. Removing it stops the chance of `FB.getLoginStatus()` getting called before `FB.init()`. Moving `Backbone.Mediator.publish "fbapi-loaded"` to after `FB.init()` also removes this chance.

In order to speed up the display of the friends playing list I added a call to render() immediately after FB is done getting their sessions. This greatly speeds up the loading time for my friends list. It was taking on average 20 seconds before the list was rendered but after this it usually pops in 5 seconds. I am not sure if there is a better/easier way to obtain this result other than a force calling of render()?