mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Quick fix to get people to the forest levels even if, for some reason, the first forest level isn't in the User list of earned levels.
This commit is contained in:
parent
2af8271829
commit
63c516c5f5
1 changed files with 3 additions and 1 deletions
|
@ -102,7 +102,7 @@ module.exports = class WorldMapView extends RootView
|
|||
context.isIPadApp = application.isIPadApp
|
||||
context.mapType = _.string.slugify @terrain
|
||||
context.nextLevel = @nextLevel
|
||||
context.forestIsAvailable = '541b67f71ccc8eaae19f3c62' in (me.get('earned')?.levels or [])
|
||||
context.forestIsAvailable = @startedForestLevel or '541b67f71ccc8eaae19f3c62' in (me.get('earned')?.levels or [])
|
||||
context
|
||||
|
||||
afterRender: ->
|
||||
|
@ -131,8 +131,10 @@ module.exports = class WorldMapView extends RootView
|
|||
@openModalView authModal
|
||||
|
||||
onSessionsLoaded: (e) ->
|
||||
forestLevels = (f.id for f in forest)
|
||||
for session in @sessions.models
|
||||
@levelStatusMap[session.get('levelID')] = if session.get('state')?.complete then 'complete' else 'started'
|
||||
@startedForestLevel = true if session.get('levelID') in forestLevels
|
||||
if @nextLevel and @levelStatusMap[@nextLevel] is 'complete'
|
||||
@nextLevel = null
|
||||
@render()
|
||||
|
|
Loading…
Reference in a new issue