mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Moved somethingLoaded calls until after calls that would register more to load. A probably suboptimal way of making sure the progress numerator never reaches the progress denominator until it's actually time.
This commit is contained in:
parent
978c84bc89
commit
1971ddcefb
1 changed files with 6 additions and 6 deletions
|
@ -40,19 +40,19 @@ module.exports = class LadderTabView extends CocoView
|
||||||
|
|
||||||
checkFriends: ->
|
checkFriends: ->
|
||||||
return if @checked or (not window.FB) or (not window.gapi)
|
return if @checked or (not window.FB) or (not window.gapi)
|
||||||
@somethingLoaded("social_network_apis")
|
|
||||||
@checked = true
|
@checked = true
|
||||||
|
|
||||||
@addSomethingToLoad("facebook_status")
|
@addSomethingToLoad("facebook_status")
|
||||||
FB.getLoginStatus (response) =>
|
FB.getLoginStatus (response) =>
|
||||||
@facebookStatus = response.status
|
@facebookStatus = response.status
|
||||||
@somethingLoaded("facebook_status")
|
|
||||||
@loadFacebookFriends() if @facebookStatus is 'connected'
|
@loadFacebookFriends() if @facebookStatus is 'connected'
|
||||||
|
@somethingLoaded("facebook_status")
|
||||||
|
|
||||||
if application.gplusHandler.loggedIn is undefined
|
if application.gplusHandler.loggedIn is undefined
|
||||||
@listenToOnce(application.gplusHandler, 'checked-state', @gplusSessionStateLoaded)
|
@listenToOnce(application.gplusHandler, 'checked-state', @gplusSessionStateLoaded)
|
||||||
else
|
else
|
||||||
@gplusSessionStateLoaded()
|
@gplusSessionStateLoaded()
|
||||||
|
@somethingLoaded("social_network_apis")
|
||||||
|
|
||||||
# FACEBOOK
|
# FACEBOOK
|
||||||
|
|
||||||
|
@ -67,10 +67,10 @@ module.exports = class LadderTabView extends CocoView
|
||||||
FB.api '/me/friends', @onFacebookFriendsLoaded
|
FB.api '/me/friends', @onFacebookFriendsLoaded
|
||||||
|
|
||||||
onFacebookFriendsLoaded: (response) =>
|
onFacebookFriendsLoaded: (response) =>
|
||||||
@somethingLoaded("facebook_friends")
|
|
||||||
@facebookData = response.data
|
@facebookData = response.data
|
||||||
@loadFacebookFriendSessions()
|
@loadFacebookFriendSessions()
|
||||||
|
@somethingLoaded("facebook_friends")
|
||||||
|
|
||||||
loadFacebookFriendSessions: ->
|
loadFacebookFriendSessions: ->
|
||||||
levelFrag = "#{@level.get('original')}.#{@level.get('version').major}"
|
levelFrag = "#{@level.get('original')}.#{@level.get('version').major}"
|
||||||
url = "/db/level/#{levelFrag}/leaderboard_facebook_friends"
|
url = "/db/level/#{levelFrag}/leaderboard_facebook_friends"
|
||||||
|
@ -105,10 +105,10 @@ module.exports = class LadderTabView extends CocoView
|
||||||
application.gplusHandler.loadFriends @gplusFriendsLoaded
|
application.gplusHandler.loadFriends @gplusFriendsLoaded
|
||||||
|
|
||||||
gplusFriendsLoaded: (friends) =>
|
gplusFriendsLoaded: (friends) =>
|
||||||
@somethingLoaded("gplus_friends")
|
|
||||||
@gplusData = friends.items
|
@gplusData = friends.items
|
||||||
@loadGPlusFriendSessions()
|
@loadGPlusFriendSessions()
|
||||||
|
@somethingLoaded("gplus_friends")
|
||||||
|
|
||||||
loadGPlusFriendSessions: ->
|
loadGPlusFriendSessions: ->
|
||||||
levelFrag = "#{@level.get('original')}.#{@level.get('version').major}"
|
levelFrag = "#{@level.get('original')}.#{@level.get('version').major}"
|
||||||
url = "/db/level/#{levelFrag}/leaderboard_gplus_friends"
|
url = "/db/level/#{levelFrag}/leaderboard_gplus_friends"
|
||||||
|
|
Loading…
Reference in a new issue