From 344d473e9bc55d1dacddbfa12e7a9940630daf99 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 24 May 2023 11:35:09 +0100
Subject: [PATCH] Don't double up app badge on Windows

---
 src/tray.ts | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/tray.ts b/src/tray.ts
index 860abb3c..87987fb6 100644
--- a/src/tray.ts
+++ b/src/tray.ts
@@ -89,7 +89,11 @@ export function create(config: IConfig): void {
         }
 
         trayIcon?.setImage(newFavicon);
-        global.mainWindow?.setIcon(newFavicon);
+
+        // Don't set the main window icon on Windows as we call Navigator::setAppBadge to do it for us
+        if (process.platform !== "win32") {
+            global.mainWindow?.setIcon(newFavicon);
+        }
     });
 
     global.mainWindow?.webContents.on("page-title-updated", function (ev, title) {