 
 
   isTimelineVisible: =>
-    @props.mode == 'timeline' && @state.sortField == 'timeline'
+    @props.mode == 'timeline' && @currentSort() == 'timeline'
 
 
   sortedDisussions: ->
     discussions = @props.currentDiscussions[@props.mode].slice(0)
-    discussions.sort sortPresets[@state.sortField].sort
+    discussions.sort sortPresets[@currentSort()].sort
 
 
   timelineCircle: =>

    super props

    @state =
      sortField: if @props.mode == 'timeline' then 'timeline' else 'created_at'


  componentWillReceiveProps: (nextProps) =>
    if _.includes(['created_at', 'timeline'], @state.sortField)
      if nextProps.mode == 'timeline'
        @setState sortField: 'timeline'
      else
        @setState sortField: 'created_at'


  render: =>

  changeSort: (e) =>
    e.preventDefault()

    sort = {}
    sort[@props.mode] = if @currentSort() == 'updated_at'
                          if @props.mode == 'timeline' then 'timeline' else 'created_at'
                        else
                          'updated_at'

    @setState sort: _.assign({}, @state.sort, sort)


  currentSort: =>
    @state.sort[@props.mode]


  expand: (e) =>
