mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-22 02:45:29 -04:00
Fixed blank duel stats bar in single player, oops. Handling getTwoGames from non-logged-in users.
This commit is contained in:
parent
066d6e7fc1
commit
d412a7d5ee
3 changed files with 5 additions and 3 deletions
app
server/queues/scoring
|
@ -15,7 +15,8 @@
|
|||
|
||||
width: 500px
|
||||
height: 60px
|
||||
display: flex
|
||||
display: none
|
||||
//display: flex // set if present
|
||||
flex-direction: row
|
||||
|
||||
&:hover
|
||||
|
|
|
@ -49,6 +49,7 @@ module.exports = class DuelStatsView extends CocoView
|
|||
super()
|
||||
for player in @players
|
||||
@buildAvatar player.heroID, player.team
|
||||
@$el.css 'display', 'flex' # Show it
|
||||
|
||||
buildAvatar: (heroID, team) ->
|
||||
@avatars ?= {}
|
||||
|
|
|
@ -37,8 +37,8 @@ getRandomSessions = (user, callback) ->
|
|||
# Determine whether to play a random match, an internal league match, or an external league match.
|
||||
# Only people in a league will end up simulating internal league matches (for leagues they're in) except by dumb chance.
|
||||
# If we don't like that, we can rework sampleByLevel to have an opportunity to switch to internal leagues if the first session had a league affiliation.
|
||||
leagueIDs = user.get('clans') or []
|
||||
#leagueIDs = leagueIDs.concat user.get('courseInstances') or []
|
||||
leagueIDs = user?.get('clans') or []
|
||||
#leagueIDs = leagueIDs.concat user?.get('courseInstances') or []
|
||||
leagueIDs = (leagueID + '' for leagueID in leagueIDs) # Make sure to fetch them as strings.
|
||||
return sampleByLevel callback unless leagueIDs.length and Math.random() > 1 / leagueIDs.length
|
||||
leagueID = _.sample leagueIDs
|
||||
|
|
Loading…
Reference in a new issue