fix: default accelerator for role-based menu items (#49558)

fix: apply default accelerator for role-based menu items

Co-authored-by: Kimgun3383 <tygob5247@gmail.com>
This commit is contained in:
Shelley Vohr
2026-02-04 22:45:29 +01:00
committed by GitHub
parent 4ea2d816b8
commit 9740c989da
4 changed files with 64 additions and 4 deletions

View File

@@ -353,6 +353,7 @@ export function shouldOverrideCheckStatus (role: RoleId) {
export function getDefaultAccelerator (role: RoleId) {
if (hasRole(role)) return roleList[role].accelerator;
return undefined;
}
export function shouldRegisterAccelerator (role: RoleId) {

View File

@@ -25,7 +25,7 @@ const MenuItem = function (this: any, options: any) {
this.overrideReadOnlyProperty('type', roles.getDefaultType(this.role));
this.overrideReadOnlyProperty('role');
this.overrideReadOnlyProperty('accelerator');
this.overrideReadOnlyProperty('accelerator', roles.getDefaultAccelerator(this.role));
this.overrideReadOnlyProperty('icon');
this.overrideReadOnlyProperty('submenu');