mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
fix(composer): Always open new composer windows from the main window so that AccountStore.current() is correct
Fixes T3479
This commit is contained in:
parent
ee7266ffb5
commit
59af9d61a0
3 changed files with 4 additions and 4 deletions
|
@ -202,7 +202,7 @@ class Atom extends Model
|
|||
# up into the browser process. This prevents us from needing this crap, which has to be
|
||||
# updated every time a new application: command is added:
|
||||
# https://github.com/atom/atom/blob/master/src/workspace-element.coffee#L119
|
||||
if event.binding.command.indexOf('application:') is 0 and event.binding.selector is "body"
|
||||
if event.binding.command.indexOf('application:') is 0 and event.binding.selector.indexOf("body") is 0
|
||||
ipc.send('command', event.binding.command)
|
||||
|
||||
unless @inSpecMode()
|
||||
|
|
|
@ -254,6 +254,7 @@ class Application
|
|||
atomWindow ?= @windowManager.focusedWindow()
|
||||
atomWindow?.browserWindow.inspectElement(x, y)
|
||||
|
||||
@on 'application:new-message', => @windowManager.sendToMainWindow('new-message')
|
||||
@on 'application:send-feedback', => @windowManager.sendToMainWindow('send-feedback')
|
||||
@on 'application:open-preferences', => @windowManager.sendToMainWindow('open-preferences')
|
||||
@on 'application:show-main-window', => @openWindowsForTokenState()
|
||||
|
|
|
@ -55,8 +55,8 @@ class DraftStore
|
|||
@listenTo Actions.composeNewBlankDraft, @_onPopoutBlankDraft
|
||||
@listenTo Actions.draftSendingFailed, @_onDraftSendingFailed
|
||||
|
||||
atom.commands.add 'body',
|
||||
'application:new-message': => @_onPopoutBlankDraft()
|
||||
if atom.isMainWindow()
|
||||
ipc.on 'new-message', => @_onPopoutBlankDraft()
|
||||
|
||||
# Remember that these two actions only fire in the current window and
|
||||
# are picked up by the instance of the DraftStore in the current
|
||||
|
@ -92,7 +92,6 @@ class DraftStore
|
|||
|
||||
ipc.on 'mailto', @_onHandleMailtoLink
|
||||
|
||||
|
||||
ipc.on 'inline-styles-result', @_onInlineStylesResult
|
||||
|
||||
# TODO: Doesn't work if we do window.addEventListener, but this is
|
||||
|
|
Loading…
Reference in a new issue