fixed crash if a very large tray image was selected

This commit is contained in:
MrGarlic 2024-05-05 14:52:45 -04:00
parent 706748f5a5
commit a85ac17bef

View file

@ -126,7 +126,8 @@ function initTray(win: BrowserWindow) {
}
}
]);
tray = new Tray(getTrayIcon());
const trayImage = nativeImage.createFromPath(getTrayIcon()).resize({ width: 32, height: 32 });
tray = new Tray(trayImage);
tray.setToolTip("Vesktop");
tray.setContextMenu(trayMenu);
tray.on("click", onTrayClick);
@ -493,7 +494,6 @@ export function getTrayIcon(): string {
const trayImage = nativeImage.createFromPath(Settings.store.trayIconPath);
if (!trayImage.isEmpty()) return Settings.store.trayIconPath;
}
return ICON_PATH;
}