diff --git a/app/tray.js b/app/tray.js index 08ccdd3..302e5bf 100644 --- a/app/tray.js +++ b/app/tray.js @@ -18,9 +18,10 @@ let tray = null; * - Handle left-click behavior (toggle window visibility). * * @param {import('electron').BrowserWindow} mainWindow - The main application window. + * @param devMode - is application packaged * @returns {Tray} The created Tray instance. */ -function createSystemTray(mainWindow) { +function createSystemTray(mainWindow, devMode) { // Prevent creating multiple instances 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. * 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(process.resourcesPath, "build", "app-icon-64x64.png"); diff --git a/main.js b/main.js index d6990d1..964bf21 100644 --- a/main.js +++ b/main.js @@ -131,7 +131,7 @@ app.whenReady().then(async () => { getMainWindow().show(); if (configFeatures.systemTray) { - createSystemTray(getMainWindow()); + createSystemTray(getMainWindow(), config.devMode); } if (configFeatures.discordRPC) startRPC();