mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-02 11:31:08 +03: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:
parent
05247bb24e
commit
d5edadabe6
@ -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,
|
||||
};
|
||||
}),
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -154,7 +154,9 @@ async function enableSplitView(page: Page) {
|
||||
})
|
||||
);
|
||||
});
|
||||
await page.reload();
|
||||
await page.reload({
|
||||
timeout: 30000,
|
||||
});
|
||||
}
|
||||
|
||||
test('open new tab via cmd+click page link', async ({ page }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user