From 07fe7ac6473e1e603f98a5fd18c6201fe91dd34a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 30 Jan 2024 14:02:16 +0000 Subject: [PATCH] Fix development issue on Windows (#1466) --- src/tray.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tray.ts b/src/tray.ts index 65fbf64..171397a 100644 --- a/src/tray.ts +++ b/src/tray.ts @@ -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);