mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-28 11:24:11 +08:00
fix(prefs): Focus main window when open prefs and prevent dupe sheets
- Fixes #498 - Fixes #484
This commit is contained in:
parent
242b54eea6
commit
84adfb3bdf
1 changed files with 4 additions and 2 deletions
|
@ -2,11 +2,11 @@
|
|||
Actions,
|
||||
WorkspaceStore,
|
||||
ComponentRegistry} = require 'nylas-exports'
|
||||
{ipcRenderer} = require 'electron'
|
||||
|
||||
module.exports =
|
||||
|
||||
activate: ->
|
||||
{ipcRenderer} = require 'electron'
|
||||
React = require 'react'
|
||||
|
||||
Cfg = PreferencesSectionStore.SectionConfig
|
||||
|
@ -45,7 +45,9 @@ module.exports =
|
|||
ipcRenderer.on 'open-preferences', => @_openPreferences()
|
||||
|
||||
_openPreferences: ->
|
||||
Actions.pushSheet(WorkspaceStore.Sheet.Preferences)
|
||||
ipcRenderer.send 'command', 'application:show-main-window'
|
||||
if WorkspaceStore.topSheet() isnt WorkspaceStore.Sheet.Preferences
|
||||
Actions.pushSheet(WorkspaceStore.Sheet.Preferences)
|
||||
|
||||
deactivate: ->
|
||||
|
||||
|
|
Loading…
Reference in a new issue