Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional menu build fix for window #1903

Merged
merged 2 commits into from
Jun 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/menus/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const darwinMenu = require('./menus/darwin');
module.exports = (createWindow, updatePlugins) => {
const commands = getKeymaps().commands;
const menu = [
(process.platform === 'darwin' ? darwinMenu(commands) : []),
Copy link
Contributor

@albinekb albinekb Jun 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...(process.platform === 'darwin' ? [darwinMenu(commands)] : []),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you copy pasted it wrong 😉 #1876 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my comment was wrong too :D
...(process.platform === 'darwin' ? [darwinMenu(commands)] : []), this should work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried (process.platform === 'darwin' ? [darwinMenu(commands)] : []), and it still causes a blank menu entry on Windows

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should keep '...' in the beginning to destructure (possible empty) array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh! that makes it work indeed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will update

...(process.platform === 'darwin' ? [darwinMenu(commands)] : []),
shellMenu(commands, createWindow),
editMenu(commands),
viewMenu(commands),
Expand Down