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,6 +407,12 @@ class DraftStore
title = if options.newDraft then "New Message" else "Message"
save.then =>
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"