fix(prefs): Focus main window when open prefs and prevent dupe sheets

- Fixes #498
- Fixes #484
This commit is contained in:
Juan Tejada 2015-11-28 09:04:55 -08:00
parent 242b54eea6
commit 84adfb3bdf

View file

@ -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: ->