Hide help link if empty.

This commit is contained in:
David Meza
2017-09-20 22:47:33 -05:00
parent 53014d48d2
commit 4f8af91f4d

View File

@@ -202,21 +202,21 @@ function createTemplate(mainWindow, config, isDev) {
}] }]
}; };
template.push(windowMenu); template.push(windowMenu);
var submenu = [];
template.push({ if (config.helpLink) {
label: '&Help', submenu.push({
submenu: [{
label: 'Learn More...', label: 'Learn More...',
click() { click() {
electron.shell.openExternal(config.helpLink); electron.shell.openExternal(config.helpLink);
} }
}, { });
type: 'separator' submenu.push(separatorItem);
}, { }
label: `Version ${electron.app.getVersion()}`, submenu.push({
enabled: false label: `Version ${electron.app.getVersion()}`,
}] enabled: false
}); });
template.push({label: '&Help', submenu});
return template; return template;
} }