From 6fa6d7664f3bf4c410875995655cb93a3c3630d1 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Wed, 28 Oct 2026 06:41:18 +0800 Subject: [PATCH] fix(setting): write auto launch patch once per toggle GuardState applies the optimistic onChange write before onGuard runs, so repeating the same onChangeData patch inside the guard handler duplicated every cache write and subscriber notification for the auto launch switch. --- src/components/setting/setting-system.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/setting/setting-system.tsx b/src/components/setting/setting-system.tsx index edf02f5d6..ed90b9622 100644 --- a/src/components/setting/setting-system.tsx +++ b/src/components/setting/setting-system.tsx @@ -58,8 +58,6 @@ const SettingSystem = ({ onError }: Props) => { }} onGuard={async (e) => { try { - // 先触发UI更新立即看到反馈 - onChangeData({ enable_auto_launch: e }) await patchVerge({ enable_auto_launch: e }) return Promise.resolve() } catch (error) {