refactor(proxies): reorder chain-mode toggle for immediate UI feedback

This commit is contained in:
Slinetrac 2025-11-22 17:04:06 +08:00
parent 51760a5b95
commit 45020fceda
No known key found for this signature in database
2 changed files with 5 additions and 5 deletions

View File

@ -38,6 +38,7 @@
- 性能优化系统状态获取
- 优化托盘菜单当前订阅检测逻辑
- 优化连接页面表格渲染
- 优化链式代理 UI 反馈
</details>

View File

@ -74,6 +74,10 @@ const ProxyPage = () => {
const onToggleChainMode = useLockFn(async () => {
const newChainMode = !isChainMode;
setIsChainMode(newChainMode);
// 保存链式代理按钮状态到 localStorage
localStorage.setItem("proxy-chain-mode-enabled", newChainMode.toString());
if (!newChainMode) {
// 退出链式代理模式时,清除链式代理配置
try {
@ -84,11 +88,6 @@ const ProxyPage = () => {
console.error("Failed to clear chain configuration:", error);
}
}
setIsChainMode(newChainMode);
// 保存链式代理按钮状态到 localStorage
localStorage.setItem("proxy-chain-mode-enabled", newChainMode.toString());
});
// 当开启链式代理模式时,获取配置数据