mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-28 15:35:37 +08:00
fix(composer-view): always show subject, unless replyToMessageId exists. fixes T3495.
Summary: add showing subject when replyToMessageId exists Test Plan: added test. all previous tests remain green. Reviewers: bengotow, evan Reviewed By: evan Maniphest Tasks: T3495 Differential Revision: https://phab.nylas.com/D1989
This commit is contained in:
parent
e95cc44418
commit
74b13ebc2d
2 changed files with 6 additions and 5 deletions
|
@ -497,7 +497,8 @@ class ComposerView extends React.Component
|
||||||
draft = @_proxy.draft()
|
draft = @_proxy.draft()
|
||||||
if _.isEmpty(draft.subject ? "") then return true
|
if _.isEmpty(draft.subject ? "") then return true
|
||||||
else if @isForwardedMessage() then return true
|
else if @isForwardedMessage() then return true
|
||||||
else return false
|
else if draft.replyToMessageId then return false
|
||||||
|
else return true
|
||||||
|
|
||||||
_shouldAcceptDrop: (event) =>
|
_shouldAcceptDrop: (event) =>
|
||||||
# Ensure that you can't pick up a file and drop it on the same draft
|
# Ensure that you can't pick up a file and drop it on the same draft
|
||||||
|
|
|
@ -246,15 +246,15 @@ describe "populated composer", ->
|
||||||
makeComposer.call @
|
makeComposer.call @
|
||||||
expect(@composer._shouldShowSubject()).toBe true
|
expect(@composer._shouldShowSubject()).toBe true
|
||||||
|
|
||||||
it "doesn't show subject when subject has fwd text in it", ->
|
it "doesn't show subject when replyToMessageId exists", ->
|
||||||
useDraft.call @, subject: "Trick fwd"
|
useDraft.call @, subject: "should hide", replyToMessageId: "some-id"
|
||||||
makeComposer.call @
|
makeComposer.call @
|
||||||
expect(@composer._shouldShowSubject()).toBe false
|
expect(@composer._shouldShowSubject()).toBe false
|
||||||
|
|
||||||
it "doesn't show the subject otherwise", ->
|
it "shows the subject otherwise", ->
|
||||||
useDraft.call @, subject: "Foo bar baz"
|
useDraft.call @, subject: "Foo bar baz"
|
||||||
makeComposer.call @
|
makeComposer.call @
|
||||||
expect(@composer._shouldShowSubject()).toBe false
|
expect(@composer._shouldShowSubject()).toBe true
|
||||||
|
|
||||||
describe "when deciding whether or not to show cc and bcc", ->
|
describe "when deciding whether or not to show cc and bcc", ->
|
||||||
it "doesn't show cc when there's no one to cc", ->
|
it "doesn't show cc when there's no one to cc", ->
|
||||||
|
|
Loading…
Add table
Reference in a new issue