Fix when checking if draft is a reply when getting accounts for send

This commit is contained in:
Juan Tejada 2016-01-26 13:54:31 -08:00
parent 3bcbec4118
commit 1435904f3c

View file

@ -530,7 +530,7 @@ class ComposerView extends React.Component
body: draft.body body: draft.body
files: draft.files files: draft.files
subject: draft.subject subject: draft.subject
accounts: @_getAccounts() accounts: @_getAccountsForSend()
if !@state.populated if !@state.populated
_.extend state, _.extend state,
@ -577,8 +577,8 @@ class ComposerView extends React.Component
enabledFields.push Fields.Body enabledFields.push Fields.Body
return enabledFields return enabledFields
_getAccounts: => _getAccountsForSend: =>
if @props.mode is 'inline' if @_proxy.draft()?.replyToMessageId?
[AccountStore.accountForId(@_proxy.draft().accountId)] [AccountStore.accountForId(@_proxy.draft().accountId)]
else else
AccountStore.accounts() AccountStore.accounts()
@ -586,7 +586,7 @@ class ComposerView extends React.Component
# When the account store changes, the From field may or may not still # When the account store changes, the From field may or may not still
# be in scope. We need to make sure to update our enabled fields. # be in scope. We need to make sure to update our enabled fields.
_onAccountStoreChanged: => _onAccountStoreChanged: =>
accounts = @_getAccounts() accounts = @_getAccountsForSend()
enabledFields = if @_shouldShowFromField(@_proxy?.draft()) enabledFields = if @_shouldShowFromField(@_proxy?.draft())
@state.enabledFields.concat [Fields.From] @state.enabledFields.concat [Fields.From]
else else