mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +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,
|
Actions,
|
||||||
WorkspaceStore,
|
WorkspaceStore,
|
||||||
ComponentRegistry} = require 'nylas-exports'
|
ComponentRegistry} = require 'nylas-exports'
|
||||||
|
{ipcRenderer} = require 'electron'
|
||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
|
|
||||||
activate: ->
|
activate: ->
|
||||||
{ipcRenderer} = require 'electron'
|
|
||||||
React = require 'react'
|
React = require 'react'
|
||||||
|
|
||||||
Cfg = PreferencesSectionStore.SectionConfig
|
Cfg = PreferencesSectionStore.SectionConfig
|
||||||
|
@ -45,6 +45,8 @@ module.exports =
|
||||||
ipcRenderer.on 'open-preferences', => @_openPreferences()
|
ipcRenderer.on 'open-preferences', => @_openPreferences()
|
||||||
|
|
||||||
_openPreferences: ->
|
_openPreferences: ->
|
||||||
|
ipcRenderer.send 'command', 'application:show-main-window'
|
||||||
|
if WorkspaceStore.topSheet() isnt WorkspaceStore.Sheet.Preferences
|
||||||
Actions.pushSheet(WorkspaceStore.Sheet.Preferences)
|
Actions.pushSheet(WorkspaceStore.Sheet.Preferences)
|
||||||
|
|
||||||
deactivate: ->
|
deactivate: ->
|
||||||
|
|
Loading…
Reference in a new issue