Skip to content

Commit cfec861

Browse files
author
pompurin404
committed
auto restart core
1 parent 559e8f2 commit cfec861

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/renderer/src/components/sider/tun-switcher.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { useControledMihomoConfig } from '@renderer/hooks/use-controled-mihomo-c
33
import BorderSwitch from '@renderer/components/base/border-swtich'
44
import { TbDeviceIpadHorizontalBolt } from 'react-icons/tb'
55
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'
712
import { useSortable } from '@dnd-kit/sortable'
813
import { CSS } from '@dnd-kit/utilities'
914
import { platform } from '@renderer/utils/init'
@@ -66,7 +71,8 @@ const TunSwitcher: React.FC = () => {
6671
onCancel={() => setOpenPasswordModal(false)}
6772
onConfirm={async (password: string) => {
6873
const encrypted = await encryptString(password)
69-
patchAppConfig({ encryptedPassword: encrypted })
74+
await patchAppConfig({ encryptedPassword: encrypted })
75+
await restartCore()
7076
setOpenPasswordModal(false)
7177
}}
7278
/>

0 commit comments

Comments
 (0)