Commit 924765f pompurin404
committed
1 parent 938802d commit 924765f Copy full SHA for 924765f
File tree 2 files changed +7
-3
lines changed
renderer/src/components/sider
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,11 @@ const buildContextMenu = (): Menu => {
86
86
checked : getControledMihomoConfig ( ) . tun ?. enable ?? false ,
87
87
click : ( item ) : void => {
88
88
const enable = item . checked
89
- setControledMihomoConfig ( { tun : { enable } } )
89
+ if ( enable ) {
90
+ setControledMihomoConfig ( { tun : { enable } , dns : { enable : true } } )
91
+ } else {
92
+ setControledMihomoConfig ( { tun : { enable } } )
93
+ }
90
94
patchMihomoConfig ( { tun : { enable } } )
91
95
window ?. webContents . send ( 'controledMihomoConfigUpdated' )
92
96
updateTrayMenu ( )
Original file line number Diff line number Diff line change @@ -34,9 +34,9 @@ const TunSwitcher: React.FC = () => {
34
34
if ( enable ) {
35
35
await patchControledMihomoConfig ( { tun : { enable } , dns : { enable : true } } )
36
36
} else {
37
- await patchControledMihomoConfig ( { tun : { enable } , dns : { enable : true } } )
38
- await patchMihomoConfig ( { tun : { enable } } )
37
+ await patchControledMihomoConfig ( { tun : { enable } } )
39
38
}
39
+ await patchMihomoConfig ( { tun : { enable } } )
40
40
}
41
41
42
42
return (
You can’t perform that action at this time.
0 commit comments