mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-27 09:36:28 +08:00
fix(tray): "Open Inbox" if main window is minimized / hidden
This commit is contained in:
parent
53bca8e2f5
commit
27ae261d1b
2 changed files with 8 additions and 6 deletions
|
@ -1,8 +1,8 @@
|
|||
import path from 'path';
|
||||
import remote from 'remote';
|
||||
import ipc from 'ipc';
|
||||
import NylasStore from 'nylas-store';
|
||||
import {UnreadCountStore, CanvasUtils} from 'nylas-exports';
|
||||
const WindowManager = remote.getGlobal('application').windowManager;
|
||||
const NativeImage = remote.require('native-image');
|
||||
const Menu = remote.require('menu');
|
||||
const {canvasWithSystemTrayIconAndText} = CanvasUtils;
|
||||
|
@ -15,25 +15,25 @@ const UNREAD_ICON_PATH = path.join(__dirname, '..', 'assets', process.platform,
|
|||
const menuTemplate = [
|
||||
{
|
||||
label: 'New Message',
|
||||
click: ()=> WindowManager.sendToMainWindow('new-message'),
|
||||
click: ()=> ipc.send('command', 'application:new-message')
|
||||
},
|
||||
{
|
||||
label: 'Preferences',
|
||||
click: ()=> WindowManager.sendToMainWindow('open-preferences'),
|
||||
click: ()=> ipc.send('command', 'application:open-preferences')
|
||||
},
|
||||
{
|
||||
type: 'separator',
|
||||
},
|
||||
{
|
||||
label: 'Quit N1',
|
||||
click: ()=> atom.quit(),
|
||||
click: ()=> ipc.send('command', 'application:quit')
|
||||
},
|
||||
];
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
menuTemplate.unshift({
|
||||
label: 'Open inbox',
|
||||
click: ()=> atom.focus(),
|
||||
label: 'Open Inbox',
|
||||
click: ()=> ipc.send('command', 'application:show-main-window')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,8 @@ class WindowManager
|
|||
@_mainWindow.focus()
|
||||
else if !@_mainWindow.isVisible()
|
||||
@_mainWindow.showWhenLoaded()
|
||||
else
|
||||
@_mainWindow.focus()
|
||||
|
||||
else
|
||||
if @devMode
|
||||
|
|
Loading…
Reference in a new issue