diff --git a/src/MenuTemplate.ts b/src/MenuTemplate.ts index d2065cd..6e5f0bc 100644 --- a/src/MenuTemplate.ts +++ b/src/MenuTemplate.ts @@ -74,7 +74,7 @@ const editMenu: MenuItemConstructorOptions = { ], } -const viewMenu = { +const viewMenu: MenuItemConstructorOptions = { label: 'View', submenu: [ { @@ -93,8 +93,9 @@ const viewMenu = { click: () => { const window = BrowserWindow.getFocusedWindow() if (window) { - const zoom = window.webContents.getZoomFactor() - window.webContents.setZoomFactor(Math.min(zoom + 0.1, 2.0)) + window.webContents.getZoomFactor((zoom) => { + window.webContents.setZoomFactor(Math.min(zoom + 0.1, 2.0)) + }) } }, }, @@ -104,15 +105,16 @@ const viewMenu = { click: () => { const window = BrowserWindow.getFocusedWindow() if (window) { - const zoom = window.webContents.getZoomFactor() - window.webContents.setZoomFactor(Math.max(zoom - 0.1, 0.5)) + window.webContents.getZoomFactor((zoom) => { + window.webContents.setZoomFactor(Math.max(zoom - 0.1, 0.5)) + }) } }, }, ], } -const template: Array<(MenuItemConstructorOptions) | (MenuItem)> = [ +const template: any = [ applicationMenu, editMenu, viewMenu,