fix: macOS app not closing

This commit is contained in:
LukeGus
2025-10-25 14:56:40 -05:00
parent f0ab525617
commit 0b4c27ef3e

View File

@@ -84,13 +84,6 @@ function createWindow() {
console.log("Frontend loaded successfully"); console.log("Frontend loaded successfully");
}); });
mainWindow.on("close", (event) => {
if (process.platform === "darwin") {
event.preventDefault();
mainWindow.hide();
}
});
mainWindow.on("closed", () => { mainWindow.on("closed", () => {
mainWindow = null; mainWindow = null;
}); });
@@ -528,16 +521,12 @@ app.whenReady().then(() => {
}); });
app.on("window-all-closed", () => { app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit(); app.quit();
}
}); });
app.on("activate", () => { app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) { if (BrowserWindow.getAllWindows().length === 0) {
createWindow(); createWindow();
} else if (mainWindow) {
mainWindow.show();
} }
}); });