feat: allow app to minimize on the systemTray. Could be disable on purpose.

This commit is contained in:
MasterAcnolo
2026-08-09 09:58:55 +02:00
committed by MasterAcnolo
parent ce2a0485ab
commit 225ccf4d2d
8 changed files with 147 additions and 8 deletions

17
main.js
View File

@@ -80,7 +80,9 @@ const { createMainWindow, getMainWindow } = require("./app/windowManager");
const { registerIpcHandlers } = require("./app/ipcHandlers");
const { createSplashWindow, closeSplashWindow, setSplashProgress } = require("./app/splashManager");
const { userThemesPath, initUserThemes, isWindows, validateBinaries, defaultDownloadFolder } = require("./server/helpers/path.helpers");
const {createSystemTray, destroyTray} = require("./app/tray");
app.isQuitting = false;
/**
* If another instance want to run
@@ -127,6 +129,11 @@ app.whenReady().then(async () => {
closeSplashWindow();
getMainWindow().show();
if (configFeatures.systemTray) {
createSystemTray(getMainWindow());
}
if (configFeatures.discordRPC) startRPC();
if (configFeatures.autoUpdate) initAutoUpdater(getMainWindow());
@@ -138,11 +145,17 @@ app.whenReady().then(async () => {
});
app.on("window-all-closed", () => {
logger.info("Shutting down...");
app.quit();
if (app.isQuitting) {
logger.info("Shutting down...");
app.quit();
} else if (process.platform !== "darwin") {
logger.info("Main window closed, app running in background (Tray).");
}
});
app.on("before-quit", async () => {
app.isQuitting = true;
destroyTray();
await stopRPC();
logger.info("All services stopped. Have a nice day!");
logSessionEnd();