From 4ae409c7f45efadb8ad89a428c11788f76e2a9ce Mon Sep 17 00:00:00 2001 From: GyDi Date: Thu, 16 Mar 2023 21:32:39 +0800 Subject: [PATCH] feat: auto restart core after grand permission --- src/components/setting/mods/clash-core-viewer.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/setting/mods/clash-core-viewer.tsx b/src/components/setting/mods/clash-core-viewer.tsx index ecef0a6..f043684 100644 --- a/src/components/setting/mods/clash-core-viewer.tsx +++ b/src/components/setting/mods/clash-core-viewer.tsx @@ -59,6 +59,8 @@ export const ClashCoreViewer = forwardRef((props, ref) => { const onGrant = useLockFn(async (core: string) => { try { await grantPermission(core); + // 自动重启 + if (core === clash_core) await restartSidecar(); Notice.success(`Successfully grant permission to ${core}`, 1000); } catch (err: any) { Notice.error(err?.message || err.toString());