From 3fe37b93bcb993544efd64210eecb9580c8e3100 Mon Sep 17 00:00:00 2001 From: go0p Date: Wed, 16 Apr 2025 11:59:53 +0800 Subject: [PATCH] fix Firefox proxy set --- src/components/ProxySwitch/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ProxySwitch/index.tsx b/src/components/ProxySwitch/index.tsx index f3d7b1f..49b31e1 100644 --- a/src/components/ProxySwitch/index.tsx +++ b/src/components/ProxySwitch/index.tsx @@ -247,7 +247,12 @@ export const ProxySwitch: React.FC = () => { await loadProxyStatus(); // 重新加载正确的状态 } else { console.log("代理模式切换成功:", mode); - setCurrentMode(mode); + // 不加 setTimeout firefox UI 会无法渲染选中状态 + setTimeout(() => { + setCurrentMode((preMode) => { + return mode === preMode ? preMode : mode; + }); + }, 20); } } catch (error) { console.error(`Error switching to proxy mode ${mode}:`, error);