mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-10 11:40:28 +08:00
fix: prevent tray icon flickering when showTraffic enabled on macOS
This commit is contained in:
parent
ae42750f34
commit
291abc0a0d
@ -528,8 +528,10 @@ export function updateTrayIconImmediate(sysProxyEnabled: boolean, tunEnabled: bo
|
||||
const status = calculateTrayIconStatus(sysProxyEnabled, tunEnabled)
|
||||
const iconPaths = getIconPaths()
|
||||
|
||||
getAppConfig().then(({ disableTrayIconColor = false }) => {
|
||||
getAppConfig().then(({ disableTrayIconColor = false, showTraffic = false }) => {
|
||||
if (!tray) return
|
||||
// macOS 开启流量显示时,由 trayIconUpdate 负责图标更新
|
||||
if (process.platform === 'darwin' && showTraffic) return
|
||||
const iconPath = disableTrayIconColor ? iconPaths.white : iconPaths[status]
|
||||
try {
|
||||
if (process.platform === 'darwin') {
|
||||
@ -549,7 +551,9 @@ export function updateTrayIconImmediate(sysProxyEnabled: boolean, tunEnabled: bo
|
||||
export async function updateTrayIcon(): Promise<void> {
|
||||
if (!tray) return
|
||||
|
||||
const { disableTrayIconColor = false } = await getAppConfig()
|
||||
const { disableTrayIconColor = false, showTraffic = false } = await getAppConfig()
|
||||
// macOS 开启流量显示时,由 trayIconUpdate 负责图标更新
|
||||
if (process.platform === 'darwin' && showTraffic) return
|
||||
const status = await getTrayIconStatus()
|
||||
const iconPaths = getIconPaths()
|
||||
const iconPath = disableTrayIconColor ? iconPaths.white : iconPaths[status]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user