fix(compose): More defensive check when switching from address, see description

This fixes #1341, but is more restrictive:

- You cannot switch From: accounts if the draft was retrieved from the sync engine (authored via Gmail or via another copy of N1. The sync-engine gives drafts a non-null threadId)

- You cannot switch From: accounts if the draft is a forward from an existing thread.

These two restrictions are unfortunately necessary to ensure that we don't have to download attachments we don't have to re-upload them to another account on the sync-engine. We could write code for this in the future but it's going to be gross.
This commit is contained in:
Ben Gotow 2016-02-19 19:19:43 -08:00
parent 5c8c139965
commit b6ebefe1ca

View file

@ -553,7 +553,7 @@ class ComposerView extends React.Component
return enabledFields
_getAccountsForSend: =>
if @_proxy.draft()?.replyToMessageId
if @_proxy.draft()?.threadId
[AccountStore.accountForId(@_proxy.draft().accountId)]
else
AccountStore.accounts()