mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 21:41:52 +08:00
fix(electron): cmd+num not working on mac (#7865)
fix AF-1248 hidden menu group + acceleratorWorksWhenHidden does not work on mac
This commit is contained in:
@@ -139,22 +139,19 @@ export function createApplicationMenu() {
|
||||
undoCloseTab().catch(console.error);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Switch to tab',
|
||||
acceleratorWorksWhenHidden: true,
|
||||
visible: false,
|
||||
submenu: [1, 2, 3, 4, 5, 6, 7, 8, 9].map(n => {
|
||||
const shortcut = `CommandOrControl+${n}`;
|
||||
const listener = () => {
|
||||
switchTab(n);
|
||||
};
|
||||
return {
|
||||
label: `Switch to tab ${n}`,
|
||||
accelerator: shortcut,
|
||||
click: listener,
|
||||
};
|
||||
}),
|
||||
},
|
||||
...[1, 2, 3, 4, 5, 6, 7, 8, 9].map(n => {
|
||||
const shortcut = `CommandOrControl+${n}`;
|
||||
const listener = () => {
|
||||
switchTab(n);
|
||||
};
|
||||
return {
|
||||
acceleratorWorksWhenHidden: true,
|
||||
label: `Switch to tab ${n}`,
|
||||
accelerator: shortcut,
|
||||
click: listener,
|
||||
visible: false,
|
||||
};
|
||||
}),
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user