From 10b38e5b41f0f6cefafc61d7b4e460309544cfcb Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 25 Oct 2023 00:30:35 +0200 Subject: [PATCH] make updater window close button close proper window --- src/main/ipc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/ipc.ts b/src/main/ipc.ts index 4fc0775..84755f4 100644 --- a/src/main/ipc.ts +++ b/src/main/ipc.ts @@ -7,7 +7,7 @@ if (process.platform === "linux") import("./virtmic"); import { execFile } from "child_process"; -import { app, dialog, RelaunchOptions, session, shell } from "electron"; +import { app, BrowserWindow, dialog, RelaunchOptions, session, shell } from "electron"; import { mkdirSync, readFileSync, watch } from "fs"; import { open, readFile } from "fs/promises"; import { release } from "os"; @@ -71,7 +71,7 @@ handle(IpcEvents.FOCUS, () => { }); handle(IpcEvents.CLOSE, e => { - mainWin.close(); + (BrowserWindow.fromWebContents(e.sender) ?? e.sender).close(); }); handle(IpcEvents.MINIMIZE, e => {