From 3a4c92a94b2235ec946f35ba7792d3e2661bd541 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Wed, 11 Nov 2015 13:44:37 -0800 Subject: [PATCH] fix(system-tray): prevent duplicate menu item on darwin --- internal_packages/system-tray/lib/tray-store.es6 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/internal_packages/system-tray/lib/tray-store.es6 b/internal_packages/system-tray/lib/tray-store.es6 index 361f2f639..95fc4b358 100644 --- a/internal_packages/system-tray/lib/tray-store.es6 +++ b/internal_packages/system-tray/lib/tray-store.es6 @@ -30,13 +30,14 @@ const menuTemplate = [ }, ]; -const _buildMenu = (platform)=> { - if (platform === 'darwin') { - menuTemplate.unshift({ - label: 'Open inbox', - click: ()=> atom.focus(), - }); - } +if (process.platform === 'darwin') { + menuTemplate.unshift({ + label: 'Open inbox', + click: ()=> atom.focus(), + }); +} + +const _buildMenu = ()=> { return Menu.buildFromTemplate(menuTemplate); };