Update "havebeenupdated" when close index.html

This commit is contained in:
Shidorien
2023-11-24 03:03:38 +01:00
parent 6c3a241481
commit 385c403bee
+5
View File
@@ -3,11 +3,16 @@ import { AppWindow } from "shared/models/window-manager/app-window.model";
import { IpcService } from "../services/ipc.service";
import { from } from "rxjs";
import { BrowserWindow, ipcMain } from "electron";
import { AutoUpdaterService } from "../services/auto-updater.service";
const ipc = IpcService.getInstance();
const autoUpdaterService = AutoUpdaterService.getInstance();
// Native windows control, do not pass through IPC service
ipcMain.on("close-window", async (event) => {
if (event.sender.getURL().includes("index.html")) {
autoUpdaterService.setHaveBeenUpdated(false);
}
BrowserWindow.fromWebContents(event.sender)?.close();
});