diff --git a/src/main/appBadge.ts b/src/main/appBadge.ts index 791bf57..9cca2c3 100644 --- a/src/main/appBadge.ts +++ b/src/main/appBadge.ts @@ -16,7 +16,7 @@ function loadBadge(index: number) { const cached = imgCache.get(index); if (cached) return cached; - const img = nativeImage.createFromPath(join(BADGE_DIR, "ico", `${index}.ico`)); + const img = nativeImage.createFromPath(join(BADGE_DIR, `${index}.ico`)); imgCache.set(index, img); return img; diff --git a/src/main/tray.ts b/src/main/tray.ts index ef1e3de..be00ef2 100644 --- a/src/main/tray.ts +++ b/src/main/tray.ts @@ -42,8 +42,7 @@ export async function setTrayIcon(iconName: string) { trayImage = nativeImage.createFromPath(join(ICONS_DIR, "icon.png")); } - const badge = lastBadgeCount > 9 ? 10 : lastBadgeCount; - const badgeSvg = readFileSync(join(BADGE_DIR, "svg", `${badge}.svg`), "utf8"); + const badgeSvg = readFileSync(join(BADGE_DIR, `badge.svg`), "utf8"); // and send IPC call to renderer to add to image mainWin.webContents.send(IpcEvents.ADD_BADGE_TO_ICON, trayImage.toDataURL(), badgeSvg); return; diff --git a/src/renderer/components/settings/TraySettings.tsx b/src/renderer/components/settings/TraySettings.tsx index cab83ff..a1183c6 100644 --- a/src/renderer/components/settings/TraySettings.tsx +++ b/src/renderer/components/settings/TraySettings.tsx @@ -117,9 +117,7 @@ function TrayModalComponent({ modalProps, close }: { modalProps: any; close: () return; } - const iconKey = - statusToSettingsKey[iconName as keyof typeof statusToSettingsKey].key; - Settings[iconKey] = true; + Settings[key] = true; const iconDataURL = VesktopNative.tray.getIconSync(iconName); const img = document.getElementById(iconName) as HTMLImageElement; if (img) { @@ -134,9 +132,7 @@ function TrayModalComponent({ modalProps, close }: { modalProps: any; close: () {Settings[key] && (