Skip to content

Commit ffdd6bc

Browse files
committed
Fix settings shortcut
1 parent cdd1b60 commit ffdd6bc

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/electron/menu.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ import { createEmitIpcMenuItemHandler } from './ipc'
44

55
const mac = process.platform === 'darwin'
66

7-
const preferencesMenuOption: MenuItemConstructorOptions = {
8-
label: 'Preferences',
9-
accelerator: 'Command+,',
10-
click: async (_menuItem, browserWindow) => {
11-
if (browserWindow == null) {
12-
console.warn('Browser window for the menu item does not exist.')
13-
return
14-
}
15-
browserWindow.webContents.send('preferences')
16-
},
17-
}
18-
197
export const template: MenuItemConstructorOptions[] = [
208
...(mac
219
? [
@@ -24,7 +12,11 @@ export const template: MenuItemConstructorOptions[] = [
2412
submenu: [
2513
{ role: 'about' },
2614
{ type: 'separator' },
27-
preferencesMenuOption,
15+
{
16+
label: 'Preferences',
17+
accelerator: 'Cmd+,',
18+
click: createEmitIpcMenuItemHandler('preferences'),
19+
},
2820
{ type: 'separator' },
2921
{
3022
label: 'Check For Updates',
@@ -94,7 +86,11 @@ export const template: MenuItemConstructorOptions[] = [
9486
click: checkForUpdates,
9587
},
9688
{ type: 'separator' },
97-
preferencesMenuOption,
89+
{
90+
label: 'Preferences',
91+
accelerator: 'Ctrl+,',
92+
click: createEmitIpcMenuItemHandler('preferences'),
93+
},
9894
{ type: 'separator' },
9995
{ role: 'quit' },
10096
] as MenuItemConstructorOptions[]),

0 commit comments

Comments
 (0)