Favor complete over incomplete sessions in CampaignView flag status

This commit is contained in:
Nick Winter 2015-11-17 15:23:34 -08:00
parent 32861b025a
commit 01c9948b5b

View file

@ -427,7 +427,8 @@ module.exports = class CampaignView extends RootView
onSessionsLoaded: (e) ->
return if @editorMode
for session in @sessions.models
@levelStatusMap[session.get('levelID')] = if session.get('state')?.complete then 'complete' else 'started'
unless @levelStatusMap[session.get('levelID')] is 'complete' # Don't overwrite a complete session with an incomplete one
@levelStatusMap[session.get('levelID')] = if session.get('state')?.complete then 'complete' else 'started'
@levelDifficultyMap[session.get('levelID')] = session.get('state').difficulty if session.get('state')?.difficulty
@render()
@loadUserPollsRecord() unless me.get 'anonymous'