 
       getCompletedAt.then (completedAt) =>
         if isNaN completedAt?.valueOf()
-          false
+          completedThisSession
         else
           # TODO: Check if the completion date is greater than the tutorial's modified_at date.
           # Return `null` to mean "Completed, but not with the most recent version".

md = new MarkdownIt
  linkify: true
  breaks: true

module.exports = React.createClass
  displayName: 'tutorial'

  
  onFinish: ->
    @props.onFinish()
    completedThisSession = true
    @props.user?.get('project_preferences', project_id: @props.project.id)
      .then ([projectPreferences]) =>
        projectPreferences ?= @props.api.type('project_preferences').create({
