diff --git a/src/main/start-main-application/lens-window/application-window/create-lens-window.injectable.ts b/src/main/start-main-application/lens-window/application-window/create-lens-window.injectable.ts index cea2dace06..88e8c60095 100644 --- a/src/main/start-main-application/lens-window/application-window/create-lens-window.injectable.ts +++ b/src/main/start-main-application/lens-window/application-window/create-lens-window.injectable.ts @@ -60,9 +60,9 @@ const createLensWindowInjectable = getInjectable({ browserWindow?.close(); browserWindow = undefined; }, - send: async (args: SendToViewArgs) => { + send: (args: SendToViewArgs) => { if (!browserWindow) { - browserWindow = await createElectronWindow(); + throw new Error(`Tried to send message to window "${configuration.id}" but the window was closed`); } return browserWindow.send(args); diff --git a/src/main/start-main-application/lens-window/application-window/lens-window-injection-token.ts b/src/main/start-main-application/lens-window/application-window/lens-window-injection-token.ts index f7273206c9..3e62b0894b 100644 --- a/src/main/start-main-application/lens-window/application-window/lens-window-injection-token.ts +++ b/src/main/start-main-application/lens-window/application-window/lens-window-injection-token.ts @@ -14,7 +14,7 @@ export interface SendToViewArgs { export interface LensWindow { show: () => Promise; close: () => void; - send: (args: SendToViewArgs) => Promise; + send: (args: SendToViewArgs) => void; visible: boolean; } diff --git a/src/main/start-main-application/lens-window/navigate-for-extension.injectable.ts b/src/main/start-main-application/lens-window/navigate-for-extension.injectable.ts index 703ef15f60..7bada3f3bd 100644 --- a/src/main/start-main-application/lens-window/navigate-for-extension.injectable.ts +++ b/src/main/start-main-application/lens-window/navigate-for-extension.injectable.ts @@ -36,7 +36,7 @@ const navigateForExtensionInjectable = getInjectable({ (frameInfo) => frameInfo.frameId === frameId, ); - await applicationWindow.send({ + applicationWindow.send({ channel: "extension:navigate", frameInfo, data: [extId, pageId, params], diff --git a/src/main/start-main-application/lens-window/navigate.injectable.ts b/src/main/start-main-application/lens-window/navigate.injectable.ts index c7cbb10d24..f9d80e4205 100644 --- a/src/main/start-main-application/lens-window/navigate.injectable.ts +++ b/src/main/start-main-application/lens-window/navigate.injectable.ts @@ -29,7 +29,7 @@ const navigateInjectable = getInjectable({ ? IpcRendererNavigationEvents.NAVIGATE_IN_CLUSTER : IpcRendererNavigationEvents.NAVIGATE_IN_APP; - await applicationWindow.send({ + applicationWindow.send({ channel, frameInfo, data: [url],