Skip to content

Commit

Permalink
Fix TypeScript errors
Browse files Browse the repository at this point in the history
The type definitions for the menuItem were fixed to make the browserWindow undefined (see electron/electron#24147).  Good thing is that our code was already handling this case.
  • Loading branch information
rafeca committed Jul 16, 2020
1 parent b4f91de commit 71e9ae6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main-process/menu/build-default-menu.ts
Expand Up @@ -245,7 +245,7 @@ export function buildDefaultMenu({
// chorded shortcuts, but this menu item is not a user-facing feature
// so we are going to keep this one around.
accelerator: 'CmdOrCtrl+Alt+R',
click(item: any, focusedWindow: Electron.BrowserWindow) {
click(item: any, focusedWindow: Electron.BrowserWindow | undefined) {
if (focusedWindow) {
focusedWindow.reload()
}
Expand All @@ -260,7 +260,7 @@ export function buildDefaultMenu({
accelerator: (() => {
return __DARWIN__ ? 'Alt+Command+I' : 'Ctrl+Shift+I'
})(),
click(item: any, focusedWindow: Electron.BrowserWindow) {
click(item: any, focusedWindow: Electron.BrowserWindow | undefined) {
if (focusedWindow) {
focusedWindow.webContents.toggleDevTools()
}
Expand Down Expand Up @@ -590,7 +590,7 @@ function getStashedChangesLabel(isStashedChangesVisible: boolean): string {

type ClickHandler = (
menuItem: Electron.MenuItem,
browserWindow: Electron.BrowserWindow,
browserWindow: Electron.BrowserWindow | undefined,
event: Electron.Event
) => void

Expand Down

0 comments on commit 71e9ae6

Please sign in to comment.