Skip to content

Commit

Permalink
fix(electron): cmd+num not working on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 committed Aug 14, 2024
1 parent 08cc15a commit 07579bc
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions packages/frontend/electron/src/main/application-menu/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}),
],
},
{
Expand Down

0 comments on commit 07579bc

Please sign in to comment.