mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 11:42:19 +08:00
auto restart core
This commit is contained in:
parent
559e8f247e
commit
cfec86102f
|
@ -3,7 +3,12 @@ import { useControledMihomoConfig } from '@renderer/hooks/use-controled-mihomo-c
|
|||
import BorderSwitch from '@renderer/components/base/border-swtich'
|
||||
import { TbDeviceIpadHorizontalBolt } from 'react-icons/tb'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { encryptString, patchMihomoConfig, isEncryptionAvailable } from '@renderer/utils/ipc'
|
||||
import {
|
||||
encryptString,
|
||||
patchMihomoConfig,
|
||||
isEncryptionAvailable,
|
||||
restartCore
|
||||
} from '@renderer/utils/ipc'
|
||||
import { useSortable } from '@dnd-kit/sortable'
|
||||
import { CSS } from '@dnd-kit/utilities'
|
||||
import { platform } from '@renderer/utils/init'
|
||||
|
@ -66,7 +71,8 @@ const TunSwitcher: React.FC = () => {
|
|||
onCancel={() => setOpenPasswordModal(false)}
|
||||
onConfirm={async (password: string) => {
|
||||
const encrypted = await encryptString(password)
|
||||
patchAppConfig({ encryptedPassword: encrypted })
|
||||
await patchAppConfig({ encryptedPassword: encrypted })
|
||||
await restartCore()
|
||||
setOpenPasswordModal(false)
|
||||
}}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue
Block a user