diff options
Diffstat (limited to 'src/lib/Menu.ts')
-rw-r--r-- | src/lib/Menu.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/Menu.ts b/src/lib/Menu.ts index 5356ec2c6..b1510cec3 100644 --- a/src/lib/Menu.ts +++ b/src/lib/Menu.ts | |||
@@ -736,15 +736,18 @@ class FranzMenu implements StoresProps { | |||
736 | { | 736 | { |
737 | label: intl.formatMessage(menuItems.toggleDevTools), | 737 | label: intl.formatMessage(menuItems.toggleDevTools), |
738 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+I`, | 738 | accelerator: `${cmdOrCtrlShortcutKey()}+${altKey()}+I`, |
739 | enabled: webContents.fromId(1) !== undefined, | ||
739 | click: () => { | 740 | click: () => { |
740 | const windowWebContents = webContents.fromId(1); | 741 | const windowWebContents = webContents.fromId(1); |
741 | const { isDevToolsOpened, openDevTools, closeDevTools } = | 742 | if (windowWebContents) { |
742 | windowWebContents; | 743 | const { isDevToolsOpened, openDevTools, closeDevTools } = |
744 | windowWebContents; | ||
743 | 745 | ||
744 | if (isDevToolsOpened()) { | 746 | if (isDevToolsOpened()) { |
745 | closeDevTools(); | 747 | closeDevTools(); |
746 | } else { | 748 | } else { |
747 | openDevTools({ mode: 'right' }); | 749 | openDevTools({ mode: 'right' }); |
750 | } | ||
748 | } | 751 | } |
749 | }, | 752 | }, |
750 | }, | 753 | }, |