diff --git a/src/main/menu/application-menu-items.injectable.ts b/src/main/menu/application-menu-items.injectable.ts index 26c4d6e3c6..b2471c6e74 100644 --- a/src/main/menu/application-menu-items.injectable.ts +++ b/src/main/menu/application-menu-items.injectable.ts @@ -10,11 +10,8 @@ import { broadcastMessage } from "../../common/ipc"; import { openBrowser } from "../../common/utils"; import { showAbout } from "./menu"; import windowManagerInjectable from "../window-manager.injectable"; -import type { - MenuItemConstructorOptions } from "electron"; -import { - webContents, -} from "electron"; +import type { MenuItemConstructorOptions } from "electron"; +import { webContents } from "electron"; import loggerInjectable from "../../common/logger.injectable"; import appNameInjectable from "../app-paths/app-name/app-name.injectable"; import electronMenuItemsInjectable from "./electron-menu-items.injectable"; @@ -67,10 +64,8 @@ const applicationMenuItemsInjectable = getInjectable({ { label: `About ${productName}`, id: "about", - click(menuItem, browserWindow) { - if (browserWindow) { - showAbout(browserWindow); - } + click() { + showAbout(); }, }, ...ignoreIf(autoUpdateDisabled, [ @@ -281,10 +276,8 @@ const applicationMenuItemsInjectable = getInjectable({ { label: `About ${productName}`, id: "about", - click(menuItem, browserWindow) { - if (browserWindow) { - showAbout(browserWindow); - } + click() { + showAbout(); }, }, ...ignoreIf(autoUpdateDisabled, [ diff --git a/src/main/menu/menu.ts b/src/main/menu/menu.ts index 6b610a8985..685b9a0837 100644 --- a/src/main/menu/menu.ts +++ b/src/main/menu/menu.ts @@ -2,7 +2,6 @@ * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ -import type { BrowserWindow } from "electron"; import { app, dialog, Menu } from "electron"; import type { IComputedValue } from "mobx"; import { autorun } from "mobx"; @@ -20,7 +19,7 @@ export function initMenu( }); } -export function showAbout(browserWindow: BrowserWindow) { +export function showAbout() { const appInfo = [ `${appName}: ${app.getVersion()}`, `Electron: ${process.versions.electron}`, @@ -29,7 +28,7 @@ export function showAbout(browserWindow: BrowserWindow) { packageJson.copyright, ]; - dialog.showMessageBoxSync(browserWindow, { + dialog.showMessageBoxSync({ title: `${isWindows ? " ".repeat(2) : ""}${appName}`, type: "info", buttons: ["Close"],