fix: register accelerator if role has no registerAccelerator (#16309)

* fix: register accelerator if role has no registerAccelerator

* ensure roles[role].registerAccelerator  is defined
This commit is contained in:
Shelley Vohr 2019-01-07 16:01:03 -08:00 committed by GitHub
parent 30c670bd83
commit b71a5a5955
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -254,7 +254,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) => {