Cleared the cacge

This commit is contained in:
2025-12-04 11:58:33 -05:00
parent 483d1286df
commit 54d8c96c7f
4 changed files with 28 additions and 10 deletions

View File

@@ -44,14 +44,22 @@
"appId": "com.lambdabanking.rmtpocketwatcher", "appId": "com.lambdabanking.rmtpocketwatcher",
"productName": "rmtPocketWatcher", "productName": "rmtPocketWatcher",
"directories": { "directories": {
"output": "release" "output": "release",
"buildResources": "resources"
}, },
"files": [ "files": [
"dist/**/*", "dist/**/*",
"package.json" "package.json"
], ],
"extraResources": [
{
"from": "resources/icons",
"to": "icons"
}
],
"win": { "win": {
"icon": "resources/icons/icon.ico",
"target": [ "target": [
"portable" "portable"
] ]

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -18,13 +18,22 @@ console.log('API_URL:', process.env.API_URL);
let mainWindow: BrowserWindow | null = null; let mainWindow: BrowserWindow | null = null;
let tray: Tray | null = null; let tray: Tray | null = null;
const isDev = process.env.NODE_ENV === 'development';
function getIconPath(): string {
if (isDev) {
return process.platform === 'win32'
? path.join(__dirname, '../../resources/icons/icon.ico')
: path.join(__dirname, '../../resources/icons/logo.png');
}
return process.platform === 'win32'
? path.join(process.resourcesPath, 'icons', 'icon.ico')
: path.join(process.resourcesPath, 'icons', 'logo.png');
}
function createWindow(): void { function createWindow(): void {
// In dev: __dirname = dist/main, logo is at root const iconPath = getIconPath();
// In prod: __dirname = resources/app.asar/dist/main
const iconPath = process.env.NODE_ENV === 'development'
? path.join(__dirname, '../../logo.png')
: path.join(__dirname, '../assets/logo.png');
console.log('Window icon path:', iconPath); console.log('Window icon path:', iconPath);
@@ -65,13 +74,14 @@ function createWindow(): void {
function createTray(): void { function createTray(): void {
// In dev: __dirname = dist/main, logo is at root // In dev: __dirname = dist/main, logo is at root
// In prod: __dirname = resources/app.asar/dist/main // In prod: __dirname = resources/app.asar/dist/main
const iconPath = process.env.NODE_ENV === 'development' const iconPath = getIconPath();
? path.join(__dirname, '../../logo.png')
: path.join(__dirname, '../assets/logo.png');
console.log('Tray icon path:', iconPath); console.log('Tray icon path:', iconPath);
const icon = nativeImage.createFromPath(iconPath).resize({ width: 16, height: 16 }); let icon = nativeImage.createFromPath(iconPath);
if (process.platform !== 'win32') {
icon = icon.resize({ width: 16, height: 16 });
}
tray = new Tray(icon); tray = new Tray(icon);