Skip to content

Commit 0f7d1a5

Browse files
committed
feat: update mac icons
1 parent 3f08369 commit 0f7d1a5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/main/tray.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ import { getProxyStatus } from './ipc/handlers'
55
let tray: Tray | null = null
66
let isProxyRunning = false
77

8+
function getIconPath(): string {
9+
if (app.isPackaged) {
10+
return join(process.resourcesPath, 'build/icon.png')
11+
}
12+
return join(__dirname, '../../build/icon.png')
13+
}
14+
815
function loadAppIcon(): nativeImage {
9-
const iconPath = join(__dirname, '../../build/icon.png')
16+
const iconPath = getIconPath()
1017

1118
try {
1219
let icon = nativeImage.createFromPath(iconPath)
@@ -49,7 +56,7 @@ function createFallbackIcon(): nativeImage {
4956
}
5057

5158
function createRunningIcon(): nativeImage {
52-
const iconPath = join(__dirname, '../../build/icon.png')
59+
const iconPath = getIconPath()
5360

5461
try {
5562
let icon = nativeImage.createFromPath(iconPath)

0 commit comments

Comments
 (0)