simplified logic for selecting tray icon on tray init

This commit is contained in:
MrGarlic 2024-05-04 20:33:43 -04:00
parent 7dacbb7dda
commit af04134c37

View file

@ -120,13 +120,10 @@ function initTray(win: BrowserWindow) {
} }
} }
]); ]);
tray = new Tray(ICON_PATH);
if (Settings.store.trayIconPath) { if (Settings.store.trayIconPath) {
const trayImage = nativeImage.createFromPath(Settings.store.trayIconPath); const trayImage = nativeImage.createFromPath(Settings.store.trayIconPath);
if (!trayImage.isEmpty()) tray = new Tray(trayImage.resize({width: 32, height: 32})); if (!trayImage.isEmpty()) tray.setImage(trayImage.resize({width: 32, height: 32}));
else tray = new Tray(ICON_PATH);
}
else {
tray = new Tray(ICON_PATH);
} }
tray.setToolTip("Vesktop"); tray.setToolTip("Vesktop");