Cleared the cacge
This commit is contained in:
@@ -18,13 +18,22 @@ console.log('API_URL:', process.env.API_URL);
|
||||
|
||||
let mainWindow: BrowserWindow | 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 {
|
||||
// In dev: __dirname = dist/main, logo is at root
|
||||
// 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');
|
||||
const iconPath = getIconPath();
|
||||
|
||||
console.log('Window icon path:', iconPath);
|
||||
|
||||
@@ -65,13 +74,14 @@ function createWindow(): void {
|
||||
function createTray(): void {
|
||||
// In dev: __dirname = dist/main, logo is at root
|
||||
// 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');
|
||||
const iconPath = getIconPath();
|
||||
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user