From ea6c5064a71d42f9d0eb758bfdbd5f1e2d1432c9 Mon Sep 17 00:00:00 2001 From: meriadec Date: Tue, 13 Feb 2018 17:38:51 +0100 Subject: [PATCH] Update condition for linux menu on prod --- src/main/menu.js | 92 ++++++++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/src/main/menu.js b/src/main/menu.js index 0c4a63ec..a4c7fcf4 100644 --- a/src/main/menu.js +++ b/src/main/menu.js @@ -19,51 +19,57 @@ const template = [ ], [], ), - ...props(process.platform === 'darwin' || __DEV__, [ - { - role: 'window', - submenu: [ - ...props( - __DEV__, - [ - { - label: 'App Dev Tools', - click() { - const devWindow = BrowserWindow.getAllWindows().find(w => w.name === 'DevWindow') - if (devWindow) { - devWindow.show() - } + ...props( + process.platform === 'darwin' || __DEV__, + [ + { + role: 'window', + submenu: [ + ...props( + __DEV__, + [ + { + label: 'App Dev Tools', + click() { + const devWindow = BrowserWindow.getAllWindows().find(w => w.name === 'DevWindow') + if (devWindow) { + devWindow.show() + } + }, }, - }, - { - label: 'Main Window Dev Tools', - click() { - const mainWindow = BrowserWindow.getAllWindows().find(w => w.name === 'MainWindow') - if (mainWindow) { - mainWindow.openDevTools({ - mode: process.env.DEV_TOOLS_MODE, - }) - } + { + label: 'Main Window Dev Tools', + click() { + const mainWindow = BrowserWindow.getAllWindows().find( + w => w.name === 'MainWindow', + ) + if (mainWindow) { + mainWindow.openDevTools({ + mode: process.env.DEV_TOOLS_MODE, + }) + } + }, }, - }, - ...props(process.platform === 'darwin', [{ type: 'separator' }], []), - ], - [], - ), - ...props( - process.platform === 'darwin', - [ - { role: 'close' }, - { role: 'minimize' }, - { role: 'zoom' }, - { type: 'separator' }, - { role: 'front' }, - ], - [], - ), - ], - }, - ]), + ...props(process.platform === 'darwin', [{ type: 'separator' }], []), + ], + [], + ), + ...props( + process.platform === 'darwin', + [ + { role: 'close' }, + { role: 'minimize' }, + { role: 'zoom' }, + { type: 'separator' }, + { role: 'front' }, + ], + [], + ), + ], + }, + ], + [], + ), ] export default Menu.buildFromTemplate(template)