fix: missing config reference in main.js and tray.js

This commit is contained in:
MasterAcnolo
2026-08-13 19:10:36 +02:00
committed by MasterAcnolo
parent 225ccf4d2d
commit dc7239379d
2 changed files with 4 additions and 3 deletions

View File

@@ -18,9 +18,10 @@ let tray = null;
* - Handle left-click behavior (toggle window visibility). * - Handle left-click behavior (toggle window visibility).
* *
* @param {import('electron').BrowserWindow} mainWindow - The main application window. * @param {import('electron').BrowserWindow} mainWindow - The main application window.
* @param devMode - is application packaged
* @returns {Tray} The created Tray instance. * @returns {Tray} The created Tray instance.
*/ */
function createSystemTray(mainWindow) { function createSystemTray(mainWindow, devMode) {
// Prevent creating multiple instances // Prevent creating multiple instances
if (tray) return tray; if (tray) return tray;
@@ -29,7 +30,7 @@ function createSystemTray(mainWindow) {
* Tip: Use a .png for Linux/macOS and a .ico for Windows for best results. * Tip: Use a .png for Linux/macOS and a .ico for Windows for best results.
* Here we use a generic PNG assuming it exists in your resources folder. * Here we use a generic PNG assuming it exists in your resources folder.
*/ */
const iconPath = config.devMode ? const iconPath = devMode ?
path.join(__dirname, "..", "build", "app-icon-64x64.png") : path.join(__dirname, "..", "build", "app-icon-64x64.png") :
path.join(process.resourcesPath, "build", "app-icon-64x64.png"); path.join(process.resourcesPath, "build", "app-icon-64x64.png");

View File

@@ -131,7 +131,7 @@ app.whenReady().then(async () => {
getMainWindow().show(); getMainWindow().show();
if (configFeatures.systemTray) { if (configFeatures.systemTray) {
createSystemTray(getMainWindow()); createSystemTray(getMainWindow(), config.devMode);
} }
if (configFeatures.discordRPC) startRPC(); if (configFeatures.discordRPC) startRPC();