mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 21:20:29 +08:00
fix tun switcher
This commit is contained in:
parent
938802d0bf
commit
924765fa80
@ -86,7 +86,11 @@ const buildContextMenu = (): Menu => {
|
||||
checked: getControledMihomoConfig().tun?.enable ?? false,
|
||||
click: (item): void => {
|
||||
const enable = item.checked
|
||||
if (enable) {
|
||||
setControledMihomoConfig({ tun: { enable }, dns: { enable: true } })
|
||||
} else {
|
||||
setControledMihomoConfig({ tun: { enable } })
|
||||
}
|
||||
patchMihomoConfig({ tun: { enable } })
|
||||
window?.webContents.send('controledMihomoConfigUpdated')
|
||||
updateTrayMenu()
|
||||
|
||||
@ -34,9 +34,9 @@ const TunSwitcher: React.FC = () => {
|
||||
if (enable) {
|
||||
await patchControledMihomoConfig({ tun: { enable }, dns: { enable: true } })
|
||||
} else {
|
||||
await patchControledMihomoConfig({ tun: { enable }, dns: { enable: true } })
|
||||
await patchMihomoConfig({ tun: { enable } })
|
||||
await patchControledMihomoConfig({ tun: { enable } })
|
||||
}
|
||||
await patchMihomoConfig({ tun: { enable } })
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user