<commit_before>import path from 'path';
import remote from 'remote';
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;

// Must be absolute real system path
// https://github.com/atom/electron/issues/1299
const BASE_ICON_PATH = path.join(__dirname, '..', 'assets', process.platform, 'ic-systemtray-nylas.png');
const UNREAD_ICON_PATH = path.join(__dirname, '..', 'assets', process.platform, 'ic-systemtray-nylas-unread.png');

const menuTemplate = [
  {
    label: 'New Message',
    click: ()=> WindowManager.sendToMainWindow('new-message'),
  },
  {
    label: 'Preferences',
    click: ()=> WindowManager.sendToMainWindow('open-preferences'),
  },
  {
    type: 'separator',
  },
  {
    label: 'Quit N1',
    click: ()=> atom.quit(),
  },
];

const _buildMenu = (platform)=> {
  if (platform === 'darwin') {
    menuTemplate.unshift({
      label: 'Open inbox',
      click: ()=> atom.focus(),
    });
  }<commit_msg>fix(system-tray): prevent duplicate menu item on darwin<commit_after>import path from 'path';
import remote from 'remote';
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;

// Must be absolute real system path
// https://github.com/atom/electron/issues/1299
const BASE_ICON_PATH = path.join(__dirname, '..', 'assets', process.platform, 'ic-systemtray-nylas.png');
const UNREAD_ICON_PATH = path.join(__dirname, '..', 'assets', process.platform, 'ic-systemtray-nylas-unread.png');

const menuTemplate = [
  {
    label: 'New Message',
    click: ()=> WindowManager.sendToMainWindow('new-message'),
  },
  {
    label: 'Preferences',
    click: ()=> WindowManager.sendToMainWindow('open-preferences'),
  },
  {
    type: 'separator',
  },
  {
    label: 'Quit N1',
    click: ()=> atom.quit(),
  },
];

if (process.platform === 'darwin') {
  menuTemplate.unshift({
    label: 'Open inbox',
    click: ()=> atom.focus(),
  });
}

const _buildMenu = ()=> {
{'fraction_non_alphanumeric': 0.16979557780559032, 'fraction_numerical': 0.004171881518564873, 'mean_word_length': 4.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5209819', 'n_tokens_mistral': 783, 'n_tokens_neox': 786, 'n_words': 161}