mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-15 00:54:55 +08:00
Summary: custom options with tests speed changes Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://review.inboxapp.com/D1383
27 lines
636 B
CoffeeScript
27 lines
636 B
CoffeeScript
_ = require 'underscore-plus'
|
|
React = require 'react'
|
|
{ThreadStore} = require 'inbox-exports'
|
|
|
|
module.exports =
|
|
MessageSubjectItem = React.createClass
|
|
displayName: 'MessageSubjectItem'
|
|
|
|
getInitialState: ->
|
|
@_getStateFromStores()
|
|
|
|
componentDidMount: ->
|
|
@_unsubscriber = ThreadStore.listen @_onChange
|
|
|
|
componentWillUnmount: ->
|
|
@_unsubscriber() if @_unsubscriber
|
|
|
|
render: ->
|
|
<div className="message-toolbar-subject">{@state.thread?.subject}</div>
|
|
|
|
_onChange: -> _.defer =>
|
|
return unless @isMounted()
|
|
@setState(@_getStateFromStores())
|
|
|
|
_getStateFromStores: ->
|
|
thread: ThreadStore.selectedThread()
|
|
|