import Ember from 'ember'
export default Ember.Route.extend
  model: -> @modelFor('project.show')

  afterModel: (model, transition) ->
    model.reload() unless @controllerFor('application').get('currentRouteName') in ['loading', 'project.show.dunlop']

  actions:
    edit_selected_project_scenario: ->
      #return unless project_scenario = @get('controller.selected_project_scenarios.firstObject')
      return unless project_scenario = @get('controller.active_project_scenario')
      @modal 'project/edit-project-scenario',
        model: project_scenario
        closeOnOverlay: false
        destroy_callback: =>
          @set 'controller.selected_project_scenario', null
