fix(drafts): Reveal or focus windows for drafts when already open

Fixes T3883
This commit is contained in:
Ben Gotow 2015-10-22 16:02:25 -07:00
parent a3dbab332e
commit cb4d3f2e39

View file

@ -407,10 +407,16 @@ class DraftStore
title = if options.newDraft then "New Message" else "Message"
save.then =>
atom.newWindow
title: title
windowType: "composer"
windowProps: _.extend(options, {draftClientId})
app = require('remote').getGlobal('application')
existing = app.windowManager.windowWithPropsMatching({draftClientId})
if existing
existing.restore() if existing.isMinimized()
existing.focus()
else
atom.newWindow
title: title
windowType: "composer"
windowProps: _.extend(options, {draftClientId})
_onHandleMailtoLink: (urlString) =>
account = AccountStore.current()