       now = new Date().toISOString()
       minicoursesCompletedThisSession[@props.minicourse.id] = now
 
-      # if @props.user?
       @state.projectPreferences.update "preferences.minicourses.completed_at.id_#{@props.minicourse.id}": now
       @state.projectPreferences.save()
     else

          if minicourse?
            @checkIfCompleted(minicourse, project, user).then (completed) =>
              unless completed
                # if user?
                user.get('project_preferences', project_id: project.id).then ([projectPreferences]) =>
                  @start minicourse, user unless projectPreferences.preferences.minicourses?.opt_out["id_#{minicourse.id}"]
                # else
                #   @start minicourse, user 

    checkIfCompleted: (minicourse, project, user) ->
      if user?

          # Create default preferences
          newProjectPreferences = @createProjectPreferences(projectPreferences, @props.minicourse.id, @props.project.id)
          @setState { projectPreferences: newProjectPreferences }
  
  componentWillUnmount: ->
    if @state.projectPreferences?
      @handleProjectPreferencesOnUnmount()
  
  render: ->
    <StepThrough ref="stepThrough" className="tutorial-steps">
