fix(star): Bulk star icon has never shown current state(?!)

This commit is contained in:
Ben Gotow 2016-02-24 19:51:17 -08:00
parent bb88d7be40
commit b2074eefc6

View file

@ -68,14 +68,19 @@ class ThreadBulkStarButton extends React.Component
selection: React.PropTypes.object.isRequired selection: React.PropTypes.object.isRequired
render: -> render: ->
noStars = _.every @props.selection.items(), (t) -> _.isMatch(t, {starred: false}) postClickStarredState = _.every @props.selection.items(), (t) -> t.starred is false
title = if noStars then "Star all" else "Remove stars from all" title = "Remove stars from all"
imageName = "toolbar-star-selected.png"
if postClickStarredState
title = "Star all"
imageName = "toolbar-star.png"
<button style={order:-104} <button style={order:-104}
className="btn btn-toolbar" className="btn btn-toolbar"
title={title} title={title}
onClick={@_onStar}> onClick={@_onStar}>
<RetinaImg name="toolbar-star.png" mode={RetinaImg.Mode.ContentIsMask} /> <RetinaImg name={imageName} mode={RetinaImg.Mode.ContentIsMask} />
</button> </button>
_onStar: => _onStar: =>