         @listenToPreferences preferences
       )
 
-  getSelectedWorkflow: (project = @state.project, preferences = @state.preferences) ->
+  getSelectedWorkflow: (project, preferences) ->
     @setState({ loadingSelectedWorkflow: true })
     # preference workflow query, then user selected workflow, then project owner set workflow, then default workflow
     # if none of those are set, select random workflow

        else
          console.log "No workflow #{selectedWorkflowID} for project #{@state.project.id}"
          @clearInactiveWorkflow(selectedWorkflowID)
            .then(@getSelectedWorkflow())

  clearInactiveWorkflow: (selectedWorkflowID) ->
    preferences = @state.preferences


  componentWillUpdate: (nextProps, nextState) ->
    if nextProps.location.query?.workflow? and @canFetchWorkflowByQuery(nextProps.project, nextProps.user)
      @getSelectedWorkflow(nextState.project, nextState.preferences) unless nextState.loadingSelectedWorkflow

    if nextState.preferences?.preferences?.selected_workflow? and @state.workflow?
      if nextState.preferences?.preferences.selected_workflow isnt @state.workflow.id
        @getSelectedWorkflow(nextState.project, nextState.preferences) unless nextState.loadingSelectedWorkflow

  componentWillUnmount: ->
    Split.clear()
