diff --git a/src/flux/stores/draft-store.coffee b/src/flux/stores/draft-store.coffee index 199aac7d8..d9a79ebca 100644 --- a/src/flux/stores/draft-store.coffee +++ b/src/flux/stores/draft-store.coffee @@ -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()