fix(compose): Enable esc-to-cancel from Cannot Send dialog (Fixes #1383)

This commit is contained in:
Ben Gotow 2016-02-19 18:59:17 -08:00
parent f1cd1056cc
commit 9f8f1750cc
2 changed files with 3 additions and 4 deletions

View file

@ -686,7 +686,7 @@ class ComposerView extends React.Component
if dealbreaker
dialog.showMessageBox(remote.getCurrentWindow(), {
type: 'warning',
buttons: ['Edit Message'],
buttons: ['Edit Message', 'Cancel'],
message: 'Cannot Send',
detail: dealbreaker
})

View file

@ -425,7 +425,7 @@ describe "ComposerView", ->
expect(@dialog.showMessageBox).toHaveBeenCalled()
dialogArgs = @dialog.showMessageBox.mostRecentCall.args[1]
expect(dialogArgs.detail).toEqual("You need to provide one or more recipients before sending the message.")
expect(dialogArgs.buttons).toEqual ['Edit Message']
expect(dialogArgs.buttons).toEqual ['Edit Message', 'Cancel']
it "shows an error if a recipient is invalid", ->
useDraft.call @,
@ -437,7 +437,7 @@ describe "ComposerView", ->
expect(@dialog.showMessageBox).toHaveBeenCalled()
dialogArgs = @dialog.showMessageBox.mostRecentCall.args[1]
expect(dialogArgs.detail).toEqual("lol is not a valid email address - please remove or edit it before sending.")
expect(dialogArgs.buttons).toEqual ['Edit Message']
expect(dialogArgs.buttons).toEqual ['Edit Message', 'Cancel']
describe "empty body warning", ->
it "warns if the body of the email is still the pristine body", ->
@ -751,4 +751,3 @@ describe "ComposerView", ->
Actions.sendDraft(DRAFT_CLIENT_ID)
secondStatus = @composer._isValidDraft()
expect(secondStatus).toBe false