         div className: lineClasses
 
 
-  displayVote: (type) ->
+  displayVote: (type) =>
     vbn = 'beatmap-discussion-vote'
 
     [baseScore, icon] = switch type

    @setState collapsed: newState


  setHighlight: (_e, {id}) ->
    newState = id == @props.discussion.id

    return if @state.highlighted == newState


bn = 'beatmap-discussion'

class BeatmapDiscussions.Discussion extends React.PureComponent
  constructor: (props) ->
    super props

    @eventId = "beatmap-discussion-entry-#{@props.discussion.id}"

    @state =
      collapsed: false
      highlighted: false


  componentWillMount: =>
    $.subscribe "beatmapDiscussionEntry:collapse.#{@eventId}", @setCollapse
    $.subscribe "beatmapDiscussionEntry:highlight.#{@eventId}", @setHighlight


  componentWillUnmount: =>
    $.unsubscribe ".#{@eventId}"
    @voteXhr?.abort()


  render: =>
    return div() if @props.discussion.beatmap_discussion_posts.length == 0

    topClasses = "#{bn} js-beatmap-discussion-jump"
