Commit cfec861 pompurin404
committed
1 parent 559e8f2 commit cfec861 Copy full SHA for cfec861
File tree 1 file changed +8
-2
lines changed
src/renderer/src/components/sider
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,12 @@ import { useControledMihomoConfig } from '@renderer/hooks/use-controled-mihomo-c
3
3
import BorderSwitch from '@renderer/components/base/border-swtich'
4
4
import { TbDeviceIpadHorizontalBolt } from 'react-icons/tb'
5
5
import { useLocation , useNavigate } from 'react-router-dom'
6
- import { encryptString , patchMihomoConfig , isEncryptionAvailable } from '@renderer/utils/ipc'
6
+ import {
7
+ encryptString ,
8
+ patchMihomoConfig ,
9
+ isEncryptionAvailable ,
10
+ restartCore
11
+ } from '@renderer/utils/ipc'
7
12
import { useSortable } from '@dnd-kit/sortable'
8
13
import { CSS } from '@dnd-kit/utilities'
9
14
import { platform } from '@renderer/utils/init'
@@ -66,7 +71,8 @@ const TunSwitcher: React.FC = () => {
66
71
onCancel = { ( ) => setOpenPasswordModal ( false ) }
67
72
onConfirm = { async ( password : string ) => {
68
73
const encrypted = await encryptString ( password )
69
- patchAppConfig ( { encryptedPassword : encrypted } )
74
+ await patchAppConfig ( { encryptedPassword : encrypted } )
75
+ await restartCore ( )
70
76
setOpenPasswordModal ( false )
71
77
} }
72
78
/>
You can’t perform that action at this time.
0 commit comments