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:
Scott Erickson 2014-11-19 10:05:02 -08:00
parent 2af8271829
commit 63c516c5f5

View file

@ -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()