mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50:30 +08:00
fix: tray icon not updating on mode change
This commit is contained in:
parent
941831728c
commit
e75fb996c2
@ -120,6 +120,7 @@ export const buildContextMenu = async (): Promise<Menu> => {
|
||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||
mainWindow?.webContents.send('groupsUpdated')
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -134,6 +135,7 @@ export const buildContextMenu = async (): Promise<Menu> => {
|
||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||
mainWindow?.webContents.send('groupsUpdated')
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -148,6 +150,7 @@ export const buildContextMenu = async (): Promise<Menu> => {
|
||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||
mainWindow?.webContents.send('groupsUpdated')
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
}
|
||||
},
|
||||
{ type: 'separator' },
|
||||
@ -167,6 +170,7 @@ export const buildContextMenu = async (): Promise<Menu> => {
|
||||
// ignore
|
||||
} finally {
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -219,6 +223,7 @@ export const buildContextMenu = async (): Promise<Menu> => {
|
||||
// ignore
|
||||
} finally {
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -237,6 +242,7 @@ export const buildContextMenu = async (): Promise<Menu> => {
|
||||
await changeCurrentProfile(item.id)
|
||||
mainWindow?.webContents.send('profileConfigUpdated')
|
||||
ipcMain.emit('updateTrayMenu')
|
||||
await updateTrayIcon()
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -381,7 +387,6 @@ async function updateTrayMenu(): Promise<void> {
|
||||
if (process.platform === 'linux') {
|
||||
tray?.setContextMenu(menu)
|
||||
}
|
||||
await updateTrayIcon()
|
||||
}
|
||||
|
||||
export async function copyEnv(type: 'bash' | 'cmd' | 'powershell'): Promise<void> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user