-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
@Stanzilla You can test it. |
Fixes it! |
@@ -12,7 +12,6 @@ const darwinMenu = require('./menus/darwin'); | |||
module.exports = (createWindow, updatePlugins) => { | |||
const commands = getKeymaps().commands; | |||
const menu = [ | |||
(process.platform === 'darwin' ? darwinMenu(commands) : []), |
There was a problem hiding this comment.
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)] : []),
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will update
Nice @chabou @ppot @Stanzilla 💯 ' |
* use speard for menu building
No description provided.