mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 05:41:05 +08:00
91edef9f7a
Conflicts: internal_packages/inbox-activity-bar/lib/activity-bar-long-poll-item.cjsx
26 lines
674 B
CoffeeScript
26 lines
674 B
CoffeeScript
_ = require 'underscore-plus'
|
|
React = require 'react'
|
|
{FocusedContentStore} = require 'nylas-exports'
|
|
|
|
class MessageSubjectItem extends React.Component
|
|
@displayName: 'MessageSubjectItem'
|
|
|
|
constructor: (@props) ->
|
|
@state = @_getStateFromStores()
|
|
|
|
componentDidMount: =>
|
|
@_unsubscriber = FocusedContentStore.listen @_onChange
|
|
|
|
componentWillUnmount: =>
|
|
@_unsubscriber() if @_unsubscriber
|
|
|
|
render: =>
|
|
<div className="message-toolbar-subject">{@state.thread?.subject}</div>
|
|
|
|
_onChange: => _.defer =>
|
|
@setState(@_getStateFromStores())
|
|
|
|
_getStateFromStores: =>
|
|
thread: FocusedContentStore.focused('thread')
|
|
|
|
module.exports = MessageSubjectItem
|