mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 21:20:29 +08:00
fix tray menu popup
This commit is contained in:
parent
60e62504ee
commit
1b8205cb18
@ -81,7 +81,7 @@ const buildContextMenu = async (): Promise<Menu> => {
|
|||||||
await patchControledMihomoConfig({ mode: 'rule' })
|
await patchControledMihomoConfig({ mode: 'rule' })
|
||||||
await patchMihomoConfig({ mode: 'rule' })
|
await patchMihomoConfig({ mode: 'rule' })
|
||||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||||
await updateTrayMenu()
|
ipcMain.emit('updateTrayMenu')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -93,7 +93,7 @@ const buildContextMenu = async (): Promise<Menu> => {
|
|||||||
await patchControledMihomoConfig({ mode: 'global' })
|
await patchControledMihomoConfig({ mode: 'global' })
|
||||||
await patchMihomoConfig({ mode: 'global' })
|
await patchMihomoConfig({ mode: 'global' })
|
||||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||||
await updateTrayMenu()
|
ipcMain.emit('updateTrayMenu')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -105,7 +105,7 @@ const buildContextMenu = async (): Promise<Menu> => {
|
|||||||
await patchControledMihomoConfig({ mode: 'direct' })
|
await patchControledMihomoConfig({ mode: 'direct' })
|
||||||
await patchMihomoConfig({ mode: 'direct' })
|
await patchMihomoConfig({ mode: 'direct' })
|
||||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||||
await updateTrayMenu()
|
ipcMain.emit('updateTrayMenu')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ type: 'separator' },
|
{ type: 'separator' },
|
||||||
@ -122,7 +122,7 @@ const buildContextMenu = async (): Promise<Menu> => {
|
|||||||
await patchAppConfig({ sysProxy: { enable: !enable } })
|
await patchAppConfig({ sysProxy: { enable: !enable } })
|
||||||
} finally {
|
} finally {
|
||||||
mainWindow?.webContents.send('appConfigUpdated')
|
mainWindow?.webContents.send('appConfigUpdated')
|
||||||
await updateTrayMenu()
|
ipcMain.emit('updateTrayMenu')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -139,7 +139,7 @@ const buildContextMenu = async (): Promise<Menu> => {
|
|||||||
}
|
}
|
||||||
await patchMihomoConfig({ tun: { enable } })
|
await patchMihomoConfig({ tun: { enable } })
|
||||||
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
mainWindow?.webContents.send('controledMihomoConfigUpdated')
|
||||||
await updateTrayMenu()
|
ipcMain.emit('updateTrayMenu')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
...groupsMenu,
|
...groupsMenu,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user