From 9e078d78a5b206fd4f58238d3132dd66a4cf2dc6 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Thu, 14 Nov 2024 22:57:01 +0800 Subject: [PATCH] auto restart core --- .../src/components/settings/mihomo-config.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/components/settings/mihomo-config.tsx b/src/renderer/src/components/settings/mihomo-config.tsx index bdcc815..b380b81 100644 --- a/src/renderer/src/components/settings/mihomo-config.tsx +++ b/src/renderer/src/components/settings/mihomo-config.tsx @@ -145,9 +145,14 @@ const MihomoConfig: React.FC = () => { size="sm" selectedKeys={new Set([mihomoCpuPriority])} onSelectionChange={async (v) => { - await patchAppConfig({ - mihomoCpuPriority: v.currentKey as Priority - }) + try { + await patchAppConfig({ + mihomoCpuPriority: v.currentKey as Priority + }) + await restartCore() + } catch (e) { + alert(e) + } }} > 实时