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

fix: register accelerator if role has no registerAccelerator (backport: 4-0-x) #16314

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/browser/api/menu-item-roles.js
Expand Up @@ -248,7 +248,8 @@ exports.getDefaultAccelerator = (role) => {
}

exports.shouldRegisterAccelerator = (role) => {
return roles.hasOwnProperty(role) ? roles[role].registerAccelerator : true
const hasRoleRegister = roles.hasOwnProperty(role) && roles[role].registerAccelerator !== undefined
return hasRoleRegister ? roles[role].registerAccelerator : true
}

exports.getDefaultSubmenu = (role) => {
Expand Down