From 9003b94f85ad2d3035612f412aa6c33a1d0ff37c Mon Sep 17 00:00:00 2001 From: Hugo C Date: Tue, 8 Aug 2023 13:08:32 +0200 Subject: [PATCH] mac: fix dock notification badge (#88) --- src/main/appBadge.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/appBadge.ts b/src/main/appBadge.ts index 0167600..46abe1d 100644 --- a/src/main/appBadge.ts +++ b/src/main/appBadge.ts @@ -23,11 +23,17 @@ let lastIndex: null | number = -1; export function setBadgeCount(count: number) { switch (process.platform) { - case "darwin": case "linux": if (count === -1) count = 0; app.setBadgeCount(count); break; + case "darwin": + if (count === 0) { + app.dock.setBadge(""); + break; + } + app.dock.setBadge(count === -1 ? "•" : count.toString()); + break; case "win32": const [index, description] = getBadgeIndexAndDescription(count); if (lastIndex === index) break;