Fix development issue on Windows (#1466)

This commit is contained in:
Michael Telatynski 2024-01-30 14:02:16 +00:00 committed by GitHub
parent 18c4c9df93
commit 07fe7ac647
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,7 +72,9 @@ export function create(config: IConfig): void {
guid = uuidv5(`${app.getName()}-${app.getPath("userData")}`, getUuid());
}
trayIcon = new Tray(defaultIcon, guid);
// Passing guid=undefined on Windows will cause it to throw `Error: Invalid GUID format`
// The type here is wrong, the param must be omitted, never undefined.
trayIcon = guid ? new Tray(defaultIcon, guid) : new Tray(defaultIcon);
trayIcon.setToolTip(config.brand);
initApplicationMenu();
trayIcon.on("click", toggleWin);